- Impact
- 4
I'm just learning about the XmlHttpRequest object. I have a basic demonstration for myself built, but I can only use it once. After pressing the "submit" button, I have to exit out of firefox before trying it again. If I press the button more than once, nothing happens.
I think I need to restart the object for accepting requests at the end of my code or something. . .but I don't know how.
Pls. . .helps. . .
I think I need to restart the object for accepting requests at the end of my code or something. . .but I don't know how.
Pls. . .helps. . .
Code:
createobjectandstuff()
{
req.onreadystatechange = function()
{
document.ajax.txt.value="Attacking...";
if(req.readyState == 4)
{
if(req.status == 200)
{
document.ajax.txt.value=req.responseText;
}
else
{
document.ajax.txt.value="Error: returned status code " + req.status + " " + req.statusText;
}
}
};
req.open("GET", "fileiwantoget.php", true);
req.send(null);
}




