【发布时间】:2020-08-02 00:40:19
【问题描述】:
我试过在body标签中加载属性没有成功
<body onload=\"updateGroup()\">
也不是在 echo 中调用函数:
echo "<script> updateGroup(); </script>";
我愿意接受批评!
function updateGroup(){
var http = new XMLHttpRequest();
var url = \"../requests/updateGroup.php\";
http.open(\"POST\", url, true);
//Send the proper header information along with the request
http.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
}
}
http.send();
}
【问题讨论】:
标签: javascript php html xmlhttprequest