djmartinaku22
New Member
- Messages
- 1
- Reaction score
- 0
- Points
- 0
I want to make a "Message of the day" panel for my portal, but for some reason i can't get the xml file to load using javascript.
This is my parser code.
This is the code i used to call the function and create the text by getting the "title" tag.
Can someone please help me out? It'll be greatly appreciated. Thank you.
This is my parser code.
Code:
function loadXMLDoc("news.xml")
{
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else // IE 5/6
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET","news.xml",false);
xhttp.send();
xmlDoc=xhttp.responseXML;
}
Code:
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue