FreeArticles
New Member
I want to display some XML Information mid-page and I find that my script isn't working, obviously because it's practically straight in the middle of the body tag..At the moment, I wish to have separate XML for separate pages. So I can have around 120-150 XML Sheets for the website that will also display differential data on each page.I have a live version here: http://universitycompare.com/university-guide/london-metropolitan-university/Alternatively, the code I am using is: \[code\]<script type="text/javascript">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","<?php echo home_url(); ?>/wp-content/themes/blue-and-grey/XML/<?php echo the_field('university_xml_courses'); ?>",false);xmlhttp.send();xmlDoc=xmlhttp.responseXML; document.write("<table border='1'>");var x=xmlDoc.getElementsByTagName("CD");for (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(x.getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue); document.write("</td><td>"); document.write(x.getElementsByTagName("TITLE")[0].childNodes[0].nodeValue); document.write("</td></tr>"); }document.write("</table>");</script>\[/code\]I know this isn't right, I know I must have to refer to the XML Script in the header, then display it in the page, but how do I go about doing this?As The XML information is not displaying...