I am using PhoneGap, in which we are allowed to use jQuery/JavaScript for manipulation operations. I make an Ajax request to a webservice I wrote in CakePHP, sending 3 things: id (from the address bar), and latitude and longitude (from HTML5 geolocation).
Now the problem is the same webservice gives correct data in the Firefox while in other browsers for the same lat
and long
it says "no data".
I used crossdomain in the Ajax request and I am using the POST method.
this is the 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');
});