jquery - Ajax request in Phonegap not working -
i have been facing issue, ajax request sent application not seem work. phonegapp android, trying run sample in android emulator eclipse.
1) failure callback getting called every time.
2) status code 0 , responsetext null.
i have gone through many links , questions none of them helped.
phonegap jquery ajax request not work.
i have change config.xml origin="*" temporarily. config.xml under resources origin=".*"
here sample code snippet using.
$.ajax({ url: "http://192.168.0.189/gcm/register.php", type: 'post', data: data, beforesend: function() { }, success: function(data, textstatus, xhr) { console.log("ajax success : " + textstatus); }, error: function(xhr, textstatus, errorthrown) { console.log(xhr.responsetext + " status : " + xhr.status); } });
response text comes null status 0
seems awkward, changed method post on both server side , client script ajax , started working.
i hope helps has struggled lot me.
Comments
Post a Comment