关于显示404问题
控制台显示
已经把文件放在http://www.imooc.com/ 域名下了 为什么查询不了 然后把整段源码显示了出来了
相关代码:
document.getElementById("save").onclick = function() {
var request = new XMLHttpRequest();
request.open("POST", "http://www.imooc.com/server.php");
var data = "name=" + document.getElementById("staffName").value
+ "&number=" + document.getElementById("staffNumber").value
+ "&sex=" + document.getElementById("staffSex").value
+ "&job=" + document.getElementById("staffJob").value;
request.setRequestHeader("Content-type","application/x-www-form-urlencoded");
request.send(data);
request.onreadystatechange = function() {
if (request.readyState===4) {
if (request.status===200) {
document.getElementById("createResult").innerHTML = request.responseText;
} else {
alert("发生错误:" + request.status);
}
}
}
}