Shoutbox

error with HttpRequest - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: error with HttpRequest (/showthread.php?tid=66834)

error with HttpRequest by Montago on 10-01-2006 at 12:32 AM

im trying to make a GET command, to download an XML

code:
function loadXMLDoc(url){
    Debug.Trace("loading XML");
   
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

    xmlhttp.open("GET",url,true);
   
    xmlhttp.onreadystatechange = function(){
        if( xmlhttp.readystate==4 ){
            Debug.Trace(xmlhttp.responseText);
           
            var response = xmlhttp.responseXML.documentElement;
            var x = response.getElementsByTagName('currency');

            for (i=0;i<x.length;i++){
                arr[i+1] = new Array(
                x[i].getAttribute('code'),
                x[i].getAttribute('rate').replace(",","."),
                x[i].getAttribute('desc') );
            }
        }//if
    }//function
    xmlhttp.send(null);
}



but, im getting an error at the xmlhttp.send(null) ... also tried send(' ')

this function loads an XML, then strip the content... but i get an error :(


also... were do i call this function to make it run a single time ??
RE: error with HttpRequest by Montago on 10-01-2006 at 12:35 AM

sorry :$

This function is perfect... it was my call that had errors - shame on me :)

also... i've found out how to run the code once...