関数 showRole(str,x)
{
もし (str=="")
{
document.getElementById("txtHintrole"+x+"").innerHTML="";
戻る;
}
if (window.XMLHttpRequest)
{// IE7+、Firefox、Chrome、Opera、Safari のコード
xmlhttp=新しい XMLHttpRequest();
}
そうしないと
{// IE6、IE5 のコード
xmlhttp = 新しい ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=関数()
{
もし (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHintrole"+x+"").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","http://localhost/tes/index.php/form/role/"+str,true);
xmlhttp.send();
}
関数 showUser(str,x)
{
もし (str=="")
{
document.getElementById("txtHint"+x+"").innerHTML="";
戻る;
}
if (window.XMLHttpRequest)
{// IE7+、Firefox、Chrome、Opera、Safari のコード
xmlhttp=新しい XMLHttpRequest();
}
そうしないと
{// IE6、IE5 のコード
xmlhttp = 新しい ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=関数()
{
もし (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint"+x+"").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","http://localhost/tes/index.php/form/hint/"+str,true);
xmlhttp.send();
}
データを表示するには両方が必要で、これで 2 つの関数を設定する方法がわからないので、この 2 つの関数を 1 つに結合できますか?
newcell.childNodes[0].setAttribute("onchange","showUser(this.value,"+xx+");");