📜  连接被拒绝 xmlhttprequest - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:45.532000             🧑  作者: Mango

代码示例1
var xhttp= new XMLHttpRequest();
xhttp.onreadystatechange = function() {
console.log(xhttp);

xhttp.onerror = function(e){
    alert("Unknown Error Occured. Server response not received.");
};

xhttp.open("POST", "http://localhost:8080/data", true);
xhttp.send();