検証のために入力テキストを xml タグと比較しようとしていますが、問題が発生しています。私のエラーは、calling() 関数の条件付きです (私は思います):
if (window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}
else{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","userPass.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
function calling(){
if(document.getElementById("userName").innerHTML==
(xmlDoc.getElementsByTagName("user")[0].childNodes[0].nodeValue){
alert("this is valid");
}
}
<form name="input" action="userPass.xml" method="post">
username <input type="text" id="userName" onchange="calling()" /><br/><br/>
password <input type="password" id="password"/><br/><br/>
<input type="submit" value="Submit" />
</form>
お時間を割いていただきありがとうございます。