标签:request document res nload xmlhttp 服务器 element cli http
window.onload = function(){
document.getElementById(‘btn‘).onclick = function(){
var req = new XMLHttpRequest();
req.open(‘get‘, ‘demo.php‘);
req.onreadystatechange = function(){
if(req.readyState == 4 && req.statu == 200){
var str = req.responseText;
alert(str)
}
}
req.send();
}
}
标签:request document res nload xmlhttp 服务器 element cli http
原文地址:https://www.cnblogs.com/wangshengl9263/p/9029578.html