October 2, 201213 yr 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://universitycom...tan-university/ Alternatively, the code I am using is: <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","http://universitycompare.com/wp-content/themes/blue-and-grey/XML/cd_catalog.xml",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[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue); document.write("</td><td>"); document.write(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue); document.write("</td></tr>"); } document.write("</table>"); </script> 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? Can't be that hard can it? As The XML information is not displaying... Edited October 2, 201213 yr by OwenONeill
October 2, 201213 yr I couldn't really understand what you want ,but can't you just use iframe to load xml file ?! Edited October 2, 201213 yr by Danny87
October 2, 201213 yr You mean in the Courses area on that Live site? You have the code within a <textarea> so it's not going to be processed.
October 2, 201213 yr Author without textarea it doesn't get processed and breaks the layout of the site, re-check the link... Edit - got it working! Edited October 2, 201213 yr by OwenONeill
Create an account or sign in to comment