Ajax.js Code:
var xmlHttp;
function S_xmlhttprequest () {
if (window. ActiveXObject) {
Xmlhttp=new ActiveXObject ("Microsoft.XMLHTTP");
}
else if (widow. XMLHttpRequest) {
Xmlhttp=new XMLHttpRequest ();
}
}
function funphp100 (URL) {
S_xmlhttprequest ();
Xmlhttp.open ("GET", "for.php?id=" +url,true);
xmlhttp.onreadystatechange=byphp;
Xmlhttp.send (NULL);
}
function byphp () {
if (xmlhttp.readystate==1) {
document.getElementById (' php100 '). Innerhtml= "Loading ...";
}
if (xmlhttp.readystate==4) {
var byphp100 = Xmlhttp.responsetext;
document.getElementById (' php100 '). innerhtml=byphp100;
}
}
for.php Code
if ($id =$_get[id]) {
for ($i =1; $i <=5; $i + +) {
echo $i;
Sleep (2);
}
Exit ();
}
?>
index.php Code:
O
T
X
Reply to discussion (solution)
if ($id =$_get[id]) {for ($i =1; $i <=5; $i + +) {echo $i;//sleep (2); } Exit ();}
Otx
What happened to my problem?
else if (widow. XMLHttpRequest) {
Xmlhttp=new XMLHttpRequest ();
}
Window
Thanks, ~~~~~~~~~~~.