Jump to content

The reload keeps reloading


sandy1028

Recommended Posts

Hi,

 

I have the code below which i have named it as ex1.php

<html>
<head>
<TITLE>
About Us
</TITLE>
</head>

<body leftMargin=0 topMargin=0>
<script type="text/javascript"> 
function Ajax(){
var xmlHttp; 
try{ 
xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari 
} catch (e){ 
try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); 
// Internet Explorer
} catch (e)
{
try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
catch (e){ 
alert("No AJAX!?"); return false; 
} 
}
}
xmlHttp.onreadystatechange=function(){ 
if(xmlHttp.readyState==4){ 
document.getElementById('ReloadThis').innerHTML=xmlHttp.responseText; setTimeout('Ajax()',1); 
} 
}
[b]xmlHttp.open("GET","./ex1.php",true);[/b]
xmlHttp.send(null);
}
window.onload=function(){
setTimeout('Ajax()',1);
}
</script>
<div id="ReloadThis" style ="position:absolute; left:30px; width:900px; top:100px; background-color: #FfFfFF"><font size = 3  color="#003366" face = "Times new roman">
<p align = "center"><font size=4 color=#006699><b>ABOUT US</b></font></p>

</div>
</body>
</html>
/code]


When I use ex1.php, the page keeps loading.
How to avoid it. 

When I change the code without refreshing manully how to auto refresh it.

Please help me

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.