Why does my we page not show correctly in Chrome browser?

Darren R August 8, 2013
Pinterest Stumbleupon Whatsapp

I’m after some advice with one of my web pages. I currently look after a website for local karate group and one of my pages uses a bit of xml to build a table and populate the date. If i browse this page via Firefox or IE, it is fine, but on Chrome its blank :(

I cannot work out for the life of me why this is happening. Appreciate any assistance…

var xmlDoc=null;
if (window.ActiveXObject)
{// code for IE
xmlDoc=new ActiveXObject(“Microsoft.XMLDOM”);
}
else if (document.implementation.createDocument)
{// code for Mozilla, Firefox, Opera, etc.
xmlDoc=document.implementation.createDocument(“”,””,null);
}
else
{
alert(‘Your browser cannot handle this script’);
}
if (xmlDoc!=null)
{
xmlDoc.async=false;
xmlDoc.load(“documents/gradings.xml”);
var x=xmlDoc.getElementsByTagName(“STUDENT”);

document.write(“”);
document.write(“”);
document.write(“NameGrade Passed”);
document.write(“”);

document.write(“”);
document.write(xmlDoc.getElementsByTagName(“MONTH”)[0].childNodes[0].nodeValue);
document.write(“”);

for (var i=0;i

Ads by Google

  1. MakeUseOf TechGuy
    August 9, 2013 at 3:07 pm

    Solution here: http://chromespot.com/forum/google-chrome-troubleshooting/1063-xml-load-issue-javascript.html

    But seriously, please rewrite that from scratch to use something more modern.

    • Darren R
      August 9, 2013 at 3:59 pm

      Hi thanks for you the solution... With regards to rewrite, Im not a web designer (as you can probably tell), but what would you suggest to use going forward...

    • MakeUseOf TechGuy
      August 9, 2013 at 4:12 pm

      Keep dynamic information in a database if you can; PHP/MySQL is relatively easy. Otherwise, rewrite using jQuery and a suitable XML parser. Anything but ActiveX.

      jQuery XML: http://net.tutsplus.com/tutorials/javascript-ajax/use-jquery-to-retrieve-data-from-an-xml-file/

  2. Bruce E
    August 9, 2013 at 1:22 am

    Please zip/rar all of the associated files for the page (html, css, js, etc) required for the page and post it on a filesharing site so we can pick it up to analyze it.