Dashcode - XmlHttpRequest - not working - readystate = 1

Discussion in 'iOS Programming' started by mindus, Aug 26, 2010.

  1. mindus macrumors newbie

    Joined:
    Aug 26, 2010
    #1
    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
     
  2. iSee macrumors 68040

    iSee

    Joined:
    Oct 25, 2004
    #2
    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
     

Share This Page