Javascript请求停留在...处理。
这是我的javascript:
function checklink() {
var hr = new XMLHttpRequest();
var url = "new_item.php";
var tratata = document.getElementById("yl1").value;
var vars = "yl=" + tratata;
hr.open("POST", url, true);
hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
hr.onreadystatechange = function () {
if (hr.readyState == 4 && hr.status == 200) {
var return_data = hr.responseText;
document.getElementById("status2").innerHTML = return_data;
}
}
hr.send(vars);
document.getElementById("status2").innerHTML = "processing...";
}
这是位于同一页面的php:
<?php
if (isset($_POST["yl"])) {
$yli = $_POST["yl"];
/* ... */
}