Need help calling array to post in Html



I am trying to get my array to read from a xml file and post into html.(My assignment is to get ajax to run from xml) My script so far is



<script type="text/javascript">
var xmlDoc;
var xmlhttp;



function loadinfo()
{
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = readinfo;
xmlhttp.open("GET", "Info.xml", true);
xmlhttp.send();


}


function readinfo()
{
if (xmlhttp.readyState == 4) {
xmlDoc = xmlhttp.informationXML;

var items = xmlDoc.getElementsByTagName("info")



var var1 = items[0].getAttribute("campus-email", "campus-phone", "online-email", "online-phone");

}
}


I made sure I added this to the body > body onload="loadinfo();"


No comments:

Post a Comment