i am using this function to permanently call from a database a string wich represent a background color value so i can get a permanent redraw but the function doesnt get called in ie. any thoughts appreciated
Code:
var p=new xhr()
function getajax(){
p.open('get',"pid_01_ajax_query.php?",true)
p.send(null)
p.onreadystatechange=function(){
if (p.readyState == 4) {
var div=document.getElementById("thediv").style.backgroundColor=p.responseText;
//alert("o")
setTimeout('getajax()',100)
}
}
}
getajax()
var div=document.getElementById("thediv").style.backgroundColor=p.responseText;
Throw a couple of alert()'s in there and verify that IE actually is using an XHR call and returning text to the page. If so, it might simply be your CSS selector.
Also, I note that your syntax is missing some semicolons, IE's scripting engine can be a buggaboo about things like that.