请帮我弄清楚这个错误:
var username = document.getElementById("username_input").value;
var password = document.getElementById("password_input").value;
var password_confirm = document.getElementById("password_confirm").value;
xhr.open('POST', 'header/onsubmit_check.php');
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("username=" + username + "&password"= + password +"&password_confirm=" + password_confirm);
答案 0 :(得分:4)
我不确定你的其他代码是什么样的,但也许你忘记了......
var xhr = new XMLHttpRequest();
修改:没关系,找到它:
改变这个:
"&password"=
对此:
"&password="