Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xmlhttprequest continuous loop

Status
Not open for further replies.

JimiRaveon

IS-IT--Management
Jun 15, 2004
57
0
0
US
I am trying to get this script to loop and keep getting error message "Object Expected" Anyone have any ideas?

Here's the code:

<html>
<head>
<script language="javascript">
function getData()
{
xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = processData;
xmlHttp.open("GET","xmltest.xml",true);
xmlHttp.send(null);
xmlDoc = xmlHttp.responseXML;
}
function processData()
{
document.write(xmlDoc.getElementsByTagName("firstname")[0].childNodes[0].nodeValue);
setTimeout(getData(),3000);
}
</script>
</head>
<body onLoad="getData()">
</body>
</html>
 
I'd try to show what xmlDoc has when you enter the processData function.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top