0

I recently found out about a program, IETester, to test my website http://www.gfcf14greendream.com/ on the different versions of internet explorer. While on chrome and firefox, my site looks like this:

enter image description here

But when I open my web site on IE8, I get this error:

enter image description here

The line for the greedream.js file is: document.getElementById("log").innerHTML = data; from the function:

function loadLog() {
    $.get("/PHP/loadlog.php", function(data) {
        document.getElementById("log").innerHTML = data;
    });
}

which loads the text file with the info that you see on the text area to the right, the "site log". This site log then appears but without any words in it. Is it that jQuery doesn't work for internet explorer 8 (and consequently any lower versions)? Thank you for any help in advance.

gfcf14
  • 316
  • 4
  • 30
  • try `$('#log').html(data)`, and be sure that the ID is right. Also what `jQuery` version are you using? – Spokey Jun 08 '13 at 23:21
  • I use this line `` to load jQuery, so I guess it is version 1.8.3 – gfcf14 Jun 08 '13 at 23:29
  • For some reason, I changed the code, and while the error screen is not displayed anymore, only the first two lines of the site log (from a text file) are displayed – gfcf14 Jun 08 '13 at 23:58
  • Your JQuery version is good for IE, and all jQuery methods used should work in ie 6 and above. I will try and debug it with IE. You can press F12 to run the IE debugger. – HMR Jun 09 '13 at 00:37

1 Answers1

0

Your problem might be caused by the following html element:

<object width="90%" height="600" 
  data="http://www.gfcf14greendream.com/thesitelog.html" type="text/html"></object>

Later the the $("#log") does not return an element in IE.

You might consider inlining the code in thesitelog.html so you can find the element with the id log.

Not sure if this will work but every time you set an object with data property the greendream.js is loaded again. Maybe when it's loaded from thesitelog.html it can access the Element with the id of 'log':

function loadLog() {
  if(/thesitelog.html$/i.test(window.location)===true){
    $.get("/PHP/loadlog.php", function(data) {
      $('#log').html(data);
    });
  }
} 
HMR
  • 37,593
  • 24
  • 91
  • 160