用html发送ajax请求浏览器端报错
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
var xhr=new XMLHttpRequest()
window.onload=function(){
doucument.getElementById("in").onclick=function(){
xhr.open("POST","/ajax","ture")
var name=doucument.getElementById("name").value()
var pass=doucument.getElementById("pass").value()
xhr.setRequestHeader("content-Type","application/x-www-form-urlencoded")
xhr.send(name,pass)
if(xhhr.onreadystatechange==4){
document.getElementById("span").innerHTML=xhr.responseText
}
}
}
</script>
用户名<input type="text" name="name" id="name" value="" /><br>
密码<input type="password" name="pass" id="pass" /><br>
<input type="button" name="" id="in" value="提交" />
<span id="span"></span>
</body>
</html>
报错为
不知道错在哪里求解答