We run a web service, and have built for it a website as a web app and an iPhone app using PhoneGap. We use ajax in both our web pages and PhoneGap pages to communicate with our server. All seems fine until one of our testing devices (iPhone 3Gs, iOS 4.3.2) constantly get empty response body from the XMLHttpRequest.
We use jQuery.ajax in the web app, and implemented a similar function in the PhoneGap app using XMLHttpRequest as well. We first found the PhoneGap app fails to sign in to our server on the ‘wretched’ iPhone 3Gs, then tried the web app on its Mobile Safari and found that fails the same. However, other websites(Google,GMail,Twitter,etc.) work with its Mobile Safari without any problem, and NONE of our other devices (even all iPhone 4.x Simulators) has this problem.
We debugged our code and found that the responseText we get from the XMLHttpRequest is malformed. When we parse it as JSON into an object, the result is an empty string (“”). However, the status code is correct.
Is there anyone who has heard of such problem? We don’t have another iPhone 3Gs with iOS 4.3.2, so it’s difficult for us to determine if this is an operating-system-side issue.
I seen a lot of issues similar to you ,, this maybe help you
https://discussions.apple.com/thread/2499350?start=15&tstart=0
Too large an AJAX response for mobile safari?
jQuery Ajax Response: Works in Browser, Null on Mobile Device
Goodluck.! 🙂