Hi to all,
I am trying to load a different xml file everytime a link is clicked, based on its href.
I have the following in head:

JAVASCRIPT


Code:
window.onload=function() {
loadXMLDoc("papers.xml"); // loads the default xml file so that page is not empty
}

function scanForXML(){
var extLinks=document.getElementById('results_list').getElementsByTagName('a');
for (i=0; i<extLinks.length; i++) {
extLinks[i].onclick=function getName()
{
var fileName=this.getAttribute('href');
loadXMLDoc(fileName);
return false;
}
}
}

HTML
HTML Code:
<ol id="results_list">
<li> <a class="tooltip" href="paper2.xml"> Teaching with Tablet PC's </a></li>
<li> <a href="paper3.xml" class="tooltip"> Tablet PCs as Instructional Tools </a></li>
</ol>
The onclick event works, I get the href value but the new xmlFile does not get loaded.
Any ideas why?

ps: no jquery plz, cannot use that. trying to learn better basic javascript


sorry here is the load code - by the way it does not work in chrome and opera - but works (the default xml file gets loaded) in safari and FF


Code:
function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET",dname,false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
}
Thanks!
K.