39,082
社区成员
发帖
与我相关
我的任务
分享
window.onload = function () {
function getXhr() {
var xhr = null;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest()
} else {
xhr = new ActiveXObject("Microsoft.XMLHttp")
}
return xhr;
}
var oLgBtn = document.getElementById('a');
oLgBtn.onmouseover = function () {
var xhr = getXhr();
xhr.open("GET", "01.php ?use=zha", true);
xhr.send(null);
alert(xhr.readyState);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
var data = xhr.responseText;
alert(data);
}
}
}
}