var req; function Init () { var select = document.getElementById ("DateSelecter"); select.onchange = UpdatePresentation; } function UpdatePresentation () { var select = document.getElementById ("DateSelecter"); if (select.value != "") loadXMLDoc ("Presentations.php?Date=" + select.value); } function processReqChange () { if (req.readyState == 4) { if (req.status == 200) { // add the data to the interface ReplacePresentation (req.responseXML); } else { alert ("there was a problem retrieving XML: " + req.statusText); } } } function ReplacePresentation (xml) { var div = document.getElementById ("PresentationDiv"); var Titles = xml.getElementsByTagName ("Title"); var Speakers = xml.getElementsByTagName ("Speaker"); div.innerHTML = Speakers[0].firstChild.nodeValue + " is speaking on " + Titles[0].firstChild.nodeValue; } // Apple XMLHttpRequest func function loadXMLDoc (url) { if (window.XMLHttpRequest) { req = new XMLHttpRequest (); req.onreadystatechange = processReqChange; req.open ("GET", url, true); req.send (null); } else if (window.ActiveXObject) { req = new ActiveXObject ("Microsoft.XMLHTTP"); if (req) { req.onreadystatechange = processReqChange; req.open ("GET", url, true); req.send (); } } }