javascript - Jquery ajax call not working on android -


i have jquery ajax calls i'm making cross domain using jsonp. code is:

$.support.cors = true; $.allowcrossdomainpages = true; $.ajax({     datatype: 'jsonp',     type: "post",     url: "http://my-url.com/getsearchresults.php",     data: {          userid: localuserid,          searchlocation: decodeuricomponent(searchlocation),          searchcategory: searchcategory      } }) .done(function(items) {     alert(items); }); 

when run in normal browser in alert box [object object] should, when run on android mobile browser returns blank alert box.

my php contains headers allow cross domain.

the actual resonse ajax call (the object) this:

[{     "address": "london road, brighton, united kingdom",     "details": {         "id": "1",         "name": "kav 2",         "logo": "user_content\/1167327737_images.jpg",         "favorite": "0",         "feedback": 0     }    }]; 

i trying find solution past 3 days. can help?

it took me while found solution.

even though ajax calls of datatype jsonp sent $_get no matter put in type, android browser, if put in type post sent $_post.

once changed type started working again.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -