This is code for updating a user's geo-coordinates in the database. It passes latitude and longitude to a php file which then updates a MySQL database. It works fine on desktops but not on mobile phones. It is properly pulling the latitude and longitude universally but on mobile phone browsers it doesn't seem to be posting or passing it to the PHP file.

function initialize_map()
    var myOptions = {
	      zoom: 4,
	      mapTypeControl: true,
	      mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
	      navigationControl: true,
	      navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
	      mapTypeId: google.maps.MapTypeId.ROADMAP      
	map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
function initialize()
		geo_position_js.getCurrentPosition(show_position,function(){document.getElementById('current').innerHTML="Couldn't get location"},{enableHighAccuracy:true});
		document.getElementById('current').innerHTML="Functionality not available";

function show_position(p)
	document.getElementById('current').innerHTML="latitude="+p.coords.latitude.toFixed(2)+" longitude="+p.coords.longitude.toFixed(2);
	var pos=new google.maps.LatLng(p.coords.latitude,p.coords.longitude);

	var infowindow = new google.maps.InfoWindow({
	    content: "<strong>yes</strong>"

	var marker = new google.maps.Marker({
	    position: pos,
	    map: map,
	    title:"You are here"

	google.maps.event.addListener(marker, 'click', function() {,marker);

var lat = p.coords.latitude.toFixed(2);
var lon = p.coords.longitude.toFixed(2);
var data = 'lat='+ lat +'&lon='+ lon;

type: "POST",
url: "updategeo.php",
timeout: 4000,
//beforeSend: function() {
//$("#loadingScreen").html('<img src="link to loading image, optional" alt="" />');
data: data,

</script >