Hi, i’ve got some problems with my script. It works perfect under Firefox, but does nothing under Internet explorer. What can I do about it?
I use this in de <head>:
[code=php]</form><p><span id=”txtHint”></span></p>
<script>
function showHint()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert (“Browser does not support HTTP Request”)
return
}
var url = “check_time.php”
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open(“GET”,url,true)
xmlHttp.send(null)
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState==”complete”)
{
document.getElementById(“txtHint”).innerHTML=xmlHttp.responseText
}
}
function GetXmlHttpObject(handler)
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject(“Microsoft.XMLHTTP”)
}
return objXMLHttp
}
setInterval(showHint, 1000);
</script>
and this in the body:
[code=php]<body Onload=showHint()>
Please help me.