Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mindus

macrumors newbie
Original poster
Aug 26, 2010
2
0
Hi
I am using xmlhttprequest in my web application in Dashcode.

Always i got readystate is 1 and the code is not executing further. my code has shown below.

var invocation = new XMLHttpRequest();
url = "http://developer.apple.com/internet/webcontent/xmlhttprequestexample/songs.xml";
var invocationHistoryText;
alert("invocation");

invocation.onload = function() {
alert("onload");
alert(invocation.readyState);
alert(invocation.status);
alert(invocation.responseText);
};
invocation.open('GET', url, true);
invocation.send(null);

if i execute the above code from my desktop its working fine. but in dashcode it is not working.

Anybody knows the solution for this?

thanks
mindus
 
Not an expert here, but perhaps you are open to suggestions rather than definitive answers since there's been no response...

I would have thought it should be

invocation.onreadystatechange = function() { ... }

(not onload as you have now)

You'd be waiting for readyState == 4
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.