views:

552

answers:

3

For some reason, my Dashcode developed application has just stopped ajax'ing and returning status codes of 0. Does anybody have any idea why.. has this happened to you?

+1  A: 

In my experience, you'll see a status of 0 when either doing cross-site scripting (where access is denied) or requesting a URL that is unreachable (typo, DNS issues, etc).

Langdon
A: 

Sorry this is not necessarily and answer but is around a similar problem. I wrote a Mac Widget using dashcode that had an ajax component. I used the XMLHttpRequest setup and load snippets from the library and successfully, it is still working, cross site scripted as it were.

I then converted this widget into a web based application for the iPhone using the iUi library. I took the XMLHttpRequest code straight across as it looked as though it would work but got a 0 back. After some hair pulling and some help from here it turned out that the browser was preventing this from XSS.

My assumption was until your question that the Widget does not prevent xss. In thinking about it how could XMLHttpRequest work from a widget if xss was prevented? The widget is loaded to a users desktop and then makes the XMLHttpRequest which by it's nature will never be in the same domain (surely?) as the site it is calling.

PurplePilot
A: 

While this is probably unrelated to dashcode, this StackOverflow question comes up when googling jQuery and an ajax status code of 0, so I thought I'd throw in an answer for those running into this issue for toher cases. I recently ran into this problem and found the following links useful:

justkt