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

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -

PHPMotion implementation - URL based videos (Hosted on separate location) -