views:

20

answers:

0

Can someone tell me why I can't set the innerHTML property of a SPAN element in IE6 or IE7? It works perfectly in IE8. The getRating function returns the value and sets the txt variable, which can be shown in an alert box. However, the rating element's innerHTML property will not update without actually refreshing the entire page.

I'm desperate for a workaround. Any help would be greatly appreciated.

function getRating() {
  xmlHttpx.onreadystatechange = function() {

    if (xmlHttpx.readyState == 4) {
      xmlDoc = xmlHttpx.responseXML;
      txt = xmlDoc.getElementsByTagName("string")[0].childNodes[0].nodeValue;
      **document.getElementById("rating").innerHTML = txt;**
      setRatings();
    }
  }

  try {
    xmlHttpx.open("GET", defaultPath + "helper.asp?URL=" + document.location, false);
    xmlHttpx.send(null);    
  }
  catch (e) {
  }
}