<html>
<head>
<title>www.tutorials.de</title>
<meta name="author" content="Quaese">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
var objRequest = false;
function instanceRequest(){
if(window.XMLHttpRequest){
objRequest = new XMLHttpRequest();
}else if(window.ActiveXObject){
try{
objRequest = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
objRequest = new ActiveXObject("Microsoft.objRequest");
}catch(e){}
}
}
if(!objRequest){
alert('Es konnte keine XMLHTTP-Instanz erzeugt werden!');
return false;
}
}
function theRequest() {
// Falls noch ein Request-Objekt existiert -> zunächst beenden
if(objRequest && objRequest.readyState){
objRequest.abort();
objRequest = false;
}
if(!objRequest){
instanceRequest();
}
objRequest.open('GET', 'xmlhttp_request_dummy.php', true);
self.objRequest.onreadystatechange = function(){
if(objRequest.readyState == 4){
if(objRequest.status == 200){
document.getElementById("outID").innerHTML = unescape(objRequest.responseText);
}else{
alert("Anfrage nicht erfolgreich!");
}
}
}
objRequest.send(null);
}
window.onload = function(){
hTimer = window.setInterval(function(){theRequest();}, 1000);
}
//-->
</script>
</head>
<body>
<div id="outID"></div>
</body>
</html>