Hi,
with Mozila everything work, but with IE didn't work. Page didn't reload.
What's wrong?
<html>
<head>
<script type="text/javascript">
setInterval("sendRequest()", 1000*2);
function createRequestObject() {
var req;
if(window.XMLHttpRequest){
// IE 7, Firefox, Safari, Opera...
req = new XMLHttpRequest();
} else if(window.ActiveXObject) {
// Internet Explorer 6, 5
req = new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert('Problem creating the XMLHttpRequest object');
}
return req;
}
var http = createRequestObject();
function sendRequest() {
http.open('GET', 'select.php', true);
http.onreadystatechange = handleResponse;
http.send(null);
}
function handleResponse() {
if(http.readyState == 4 && http.status == 200){
var response = http.responseText;
if(response)
{
document.getElementById('text').innerHTML = response;
}
}
}
</script>
</head>
<body>
<div id="text"></div>
</body>
</html>