XMLHTTPRequest.send method failing

Z

zdrakec

The relevent code (it's a basic example):

var XMLHTTP = GetXMLHTTP();
if(XMLHTTP != null)
{
XMLHTTP.open("GET","default.aspx");
XMLHTTP.onreadystatechanged = stateChanged;
XMLHTTP.send(null);
} //end if(XMLHTTP != null)

function stateChanged()
{
if(XMLHTTP.readyState == 4 && XMLHTTP.status == 200)
{
window.alert(XMLHTTP.responseText);
} //end if
}//end function stateChanged

When I run this in the browser, I get a javascript exception for the
"XMLHTTP.send(null);" line:
"Object does not support this property or method."

Help...?

Thanks,

zdrakec
 
T

three-seven

Hi!

See attentive...

var XMLHTTP = GetXMLHTTP();

if(XMLHTTP != null)
{
XMLHTTP.open("GET","default.aspx");
XMLHTTP.onreadystatechange = stateChanged; // SEE HERE!!!
onreadystatechangE (you write - onreadystatechangED). Correct.
XMLHTTP.send(null);



} //end if(XMLHTTP != null)


function stateChanged()
{
if(XMLHTTP.readyState == 4 && XMLHTTP.status == 200)
{
window.alert(XMLHTTP.responseText);
} //end if
}//end function stateChanged

}
 
Z

zdrakec

Hi!

See attentive...

var XMLHTTP = GetXMLHTTP();

if(XMLHTTP != null)
{
XMLHTTP.open("GET","default.aspx");
XMLHTTP.onreadystatechange = stateChanged; // SEE HERE!!!
onreadystatechangE (you write - onreadystatechangED). Correct.
XMLHTTP.send(null);

} //end if(XMLHTTP != null)

function stateChanged()
{
if(XMLHTTP.readyState == 4 && XMLHTTP.status == 200)
{
window.alert(XMLHTTP.responseText);
} //end if
}//end function stateChanged



}- Hide quoted text -

- Show quoted text -

Well dammit. That is truly annoying, and convinces me that I'm getting
senile.

Thank you sir!

zdrakec
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top