}
if(xmlhttp.readyState==4){
var msg = xmlhttp.responseText;
document.getElementById('divc').innerHTML = msg;
}
}
</script>
</head>

<body>
<a href="#" onClick="fun100('a')">a</a>
<div id="divc"></div>
-----------------------------------------------------
<?php
$id = $_GET['id'];
for($i=1;$i<3;$i++){
echo $id;
sleep(2);
}
?>
分享到:

------解决方案--------------------
    var xmlhttp;
    function fun100(url) {
        xmlhttp = new XMLHttpRequest();
        xmlhttp.open('GET', '2.html', true);
        document.getElementById('divc').innerHTML = "loading...";

        xmlhttp.onreadystatechange = byphp;
        xmlhttp.send(null);
    }
    function byphp() {
        if (xmlhttp.readyState == 4) {
            var msg = xmlhttp.responseText;
            document.getElementById('divc').innerHTML = msg;
        }
    }
查看全文
  相关解决方案