if (typeof XMLHttpRequest == "undefined" ) { // Provide the XMLHttpRequest class for IE 5.x-6.x: XMLHttpRequest = function() { try { return new ActiveXObject("Microsoft.XMLHTTP") } catch(e) {} try { return new ActiveXObject("Msxml2.XMLHTTP.6.0") } catch(e) {} try { return new ActiveXObject("Msxml2.XMLHTTP.3.0") } catch(e) {} try { return new ActiveXObject("Msxml2.XMLHTTP") } catch(e) {} throw new Error( "This browser does not support XMLHttpRequest." ) }; } function issues_handler() { if (this.readyState == 4 && this.status == 200) { if (this.responseXML != null) { // success! var div = this.responseXML.getElementById('content'); var anchors = div.getElementsByTagName("a"); var issues = 0; var ac_open = 0; var ac_overdue = 0; for (var i =0; i < anchors.length; i++) { var a = anchors.item(i); var href = a.getAttribute("href"); if (href == "issues/open") { alert("Issues " + a.nextSibling); } else if (href == "actions/open") { } else if (href == "actions/overdue") { } // pre.appendChild(document.createTextNode(this.responseText)); // div.appendChild(pre); } } else { } } } // Display the source of a test function displayIssues() { try { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = issues_handler; xhr.open("GET", "http://www.w3.org/AudioVideo/TT/tracker/", true); xhr.send(""); } catch (e) { // ignore } } function init() { if (!(document.implementation && document.implementation.hasFeature)) { // no DOM support :-( return; } displayIssues(); }