Internet Explorer 8: jQuery load issue?

562 views Asked by At

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.

1

There are 1 answers

0
HMR On

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);
    });
  }
}