parse XML file with javascript in variable on click

bousernamee5

New Member
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.onclick=function getName(){var fileName=this.getAttribute('href');loadXMLDoc(fileName);return false;}}}\[/code\]HTML\[code\]<ol id="results_list"><li> <a class="tooltip" href="http://stackoverflow.com/questions/11260773/paper2.xml"> Teaching with Tablet PC's </a></li><li> <a href="http://stackoverflow.com/questions/11260773/paper3.xml" class="tooltip"> Tablet PC
 
Back
Top