AJAX cross domain XML requests on mobile Phones

This is a short Post but I will confirm certain things that took me a while to clarify. First of all, I know this because I’ve tested it and I used it in 2 apps, so I’m not guessing here.

Both the Palm Pre Browser and Mobile Safari (iPhone, iPod Touch, iPad) can make AJAX with XML from a local page. Meaning if you’re using Palm Mojo and you want to retrieve some XML from wherever to your app you can. Same thing on the iPhone if you’re making Apps with HTML 5 using Phonegap or something similar. You can do the request if your file is local.

Now, cross domain like from one domain to another, I don’t know. But I do know something, this that I mentioned here does not work from a browser on a computer. At least not on Firefox, IE and Chrome (both Mac and PC).

Update October 27th 2010

Wrong, wrong, wrong. On the Pre yes, it does work. I only tested with Delicious.com, though. They might have their server settings set to allow cross-domain requests. On the iPhone it didn’t work at all. We ended up having to use a proxy script to translate JSONP into XML. The script runs on the server where the backend lies and it talks to the web-service.

My tests were not done properly. I was just pulling an XML document from another server. If you actually try to make a SOAP request from the iPhone using javascript, good luck.

Switch to our mobile site