php - Cross-browser issue while using jQuery Mobile -


i using phonegap, in allowed use jquery/javascript manipulation operations. make ajax request webservice wrote in cakephp, sending 3 things: id (from address bar), , latitude , longitude (from html5 geolocation).

now problem same webservice gives correct data in firefox while in other browsers same lat , long says "no data".

i used crossdomain in ajax request , using post method.

this request code

var request= $.ajax({             type: "post",             url: 'url',              data:{ id: localstorage.getitem("id"), latitude: localstorage.latitude,longitude: localstorage.longitude},             crossdomain: true,             datatype: "xml",             cache: false        }); request.done(function (data){ //show data }); request.fail(function (data){ alert('error'); }); 

try test

if(navigator.geolocation) {   // api working } else {   // no support } 

it tell if thebrowser using accept geolocation api.


Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

How to mention the localhost in android -

php - Calling a template part from a post -