happy31 Posted February 25, 2015 Share Posted February 25, 2015 when we are running that script on local machine then give a correct output but when run on server then create some problem function GEOprocess(position) { document.getElementById('geo'); // now we send this data to the php script behind the scenes with the GEOajax function GEOajax("geo.php?accuracy=" + position.coords.accuracy + "&latlng=" + position.coords.latitude + "," + position.coords.longitude +"&altitude="+position.coords.altitude+"&altitude_accuracy="+position.coords.altitudeAccuracy+"&heading="+position.coords.heading+"&speed="+position.coords.speed+""); } // this is used when the visitor bottles it and hits the "Don't Share" option function GEOdeclined(error) { document.getElementById('geo').innerHTML = 'Error: ' + error.message; } if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(GEOprocess, GEOdeclined); }else{ document.getElementById('geo').innerHTML = 'Your browser sucks. Upgrade it.'; } // this checks if the browser supports XML HTTP Requests and if so which method if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); }else if(window.ActiveXObject){ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } // this calls the php script with the data we have collected from the geolocation lookup function GEOajax(url) { xmlHttp.open("GET", url, true); xmlHttp.onreadystatechange = updatePage; xmlHttp.send(null); } // this reads the response from the php script and updates the page with it's output function updatePage() { if (xmlHttp.readyState == 4) { var response = xmlHttp.responseText; document.getElementById("geo").innerHTML = '' + response; } } so please give me some advise what we can do? Link to comment Share on other sites More sharing options...
happy31 Posted February 25, 2015 Author Share Posted February 25, 2015 can any one suggest me? Link to comment Share on other sites More sharing options...
happy31 Posted February 26, 2015 Author Share Posted February 26, 2015 give some advise me Link to comment Share on other sites More sharing options...
nhproject Posted February 26, 2015 Share Posted February 26, 2015 Hi! Which are the errors that you get? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now