jquery - server side scripting in to javascript -
i try latitude , longitude value ip address
after getting lat , lng value post in php file using ajax , generate new xml file
this html file:-
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="http://j.maxmind.com/app/geoip.js" ></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script> function getlg(){ var lan=geoip_latitude(); var lng=geoip_longitude(); var gen = $('#sex').val(); var date = $('#date').val(); $.ajax({ type: "post", url: "http://localhost/svn/trunk/home/url.php?lat="+lan+"&lng="+lng+'&radius'+$('#radius1').val(), contenttype: "text/html", success: function(token) { }, error:function (xhr, ajaxoptions, thrownerror){ alert(xhr.statustext); alert(thrownerror); } }); } </script> <body> <div id="region"><h5></h5></div> enter radius: <input type="text" id="radius1"></input> <input type="button" id="filter"onclick="getlg()" value="go"> </body> </head> </html>
php file:-
<?php function convertnodevaluechars($node) { if ($node->haschildnodes()) { foreach ($node->childnodes $childnode) { if ($childnode->nodetype == xml_text_node) { $childnode->nodevalue = iconv('utf-8', 'ascii//translit', $childnode->nodevalue); } convertnodevaluechars($childnode); } } } $url='http://services.gisgraphy.com/geoloc/search?lat='.$_get['lat'].'&lng='.$_get['lng'].'&radius='.$_get['radius']; $doc = new domdocument(); $doc->load($url); $doc->save('general.xml'); ?>
in file try lat , long , radius html ajax function , getting 1 new xml file of url.
take time if radius biggest.
want try php code in java script dont server side scripting.
please me out this...
thanks...
try this:-
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="http://j.maxmind.com/app/geoip.js" ></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script> function myfunction(){ var lan=geoip_latitude(); var lng=geoip_longitude(); var gen = $('#sex').val(); var date = $('#date').val(); var location = "http://services.gisgraphy.com/geoloc/search?lat="+lan+"&lng="+lng+'&radius'+$('#radius1').val(); document.write('<a href="' + location + '">link text</a>'); } </script> <body> <div id="region"><h5></h5></div> <input type="text" id="radius1" onchange="myfunction()"></input> </body> </head>
Comments
Post a Comment