javascript - Reset user geo location on page load. Delete & set a cookie -
i'm running geo-location-javascript (http://code.google.com/p/geo-location-javascript/) find , set users latitude , longitude cookie.
i'm running try , update cookie on each page load.
<script> function del_cookie(name) { document.cookie = name + '=; expires=thu, 01-jan-70 00:00:01 gmt;'; } if(geo_position_js.init()){ geo_position_js.getcurrentposition(success,error); } else{ alert("functionality not available"); } function success(p) { del_cookie('user_latitude'); del_cookie('user_longitude'); document.cookie = "user_latitude=" + p.coords.latitude; document.cookie = "user_longitude=" + p.coords.longitude; $('body').load('pool.php'); } function error(p) { alert('error='+p.message); $('body').load('error.html'); } </script>
but doesn't seem update on each page load, @ least iphone. ideas? or maybe more efficient way this?
i want able date location information of mobile user.
Comments
Post a Comment