有个javascript的问题想问一下..关于把函数当参数传递的问题 function checkAccount() {
CheckInfo.checkAccountNo($get("txtAccount").value, $get("txtCode").value, show);
}
function show(result) {
if (result == "1") { $get("divAccount").innerHTML = "银行账号正确!";
document.getElementById("divAccount").style.display = "none"; }
if (result == "0") { $get("divAccount").innerHTML = "银行账号有误,请及时联系储运给更改";
document.getElementById("divAccount").style.display = "block";
$get("txtAccount").value = ""; }
}其中 CheckInfo.checkAccountNo 是已注册的webservice他的签名信息[WebMethod]
public string checkAccountNo(string account, string cu_no)我想问的是..在文本框 onBlur="checkAccount();
最后怎么会触发 function show()
他依据的是什么.
CheckInfo.checkAccountNo($get("txtAccount").value, $get("txtCode").value, show);
}
function show(result) {
if (result == "1") { $get("divAccount").innerHTML = "银行账号正确!";
document.getElementById("divAccount").style.display = "none"; }
if (result == "0") { $get("divAccount").innerHTML = "银行账号有误,请及时联系储运给更改";
document.getElementById("divAccount").style.display = "block";
$get("txtAccount").value = ""; }
}其中 CheckInfo.checkAccountNo 是已注册的webservice他的签名信息[WebMethod]
public string checkAccountNo(string account, string cu_no)我想问的是..在文本框 onBlur="checkAccount();
最后怎么会触发 function show()
他依据的是什么.
给checkAccount();他一个参数:checkAccount(result);
这样写就行了。
如:function checkAccount(result) {
CheckInfo.checkAccountNo($get("txtAccount").value, $get("txtCode").value, show);
show(result);
}
namespace.CheckInfo.checkAccountNo($get("txtAccount").value, $get("txtCode").value, show);
}
这个是webservice 的内部机制么?参数列表最后一个参数是函数的时候