I want to access open API through ajax in mobile application, its work fine in iphone but does not working in Android phonegap application:
returning error->\"e
It seems that there is a parse error on the data fetched. You want the XMLHttpRequest to parse XML data, so the fetched URL has to return valid XML. There are several possible reasons why that works on one but fails on another platform:
-The browser request headers may be different, resulting in a different server answer. Some servers may give HTTP 200 status answers with some error message in case of problems, which doesn't parse to valid XML.
-The returned XML may be problematic and parses well on the iPhone due to quirks in the browser there but fail on another WebKit version / variant the Android uses.
-The fetched data is damaged due to other request headers, provider, proxy or other effects. For example some proxys only handle HTTP/1.0 requests, and bad behaving servers serve HTTP/1.1 with chunked encoding every time, so the XML will be damaged by the chunk headers.
For debugging purposes you can change the request to a text request and show the fetched data, or even save it to the devices SD card if possible in your application. You can then verify it has arrived intact and is in fact valid XML.