有个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()
他依据的是什么.

解决方案 »

  1.   

    你把show();放在checkAccount();这里面啊。
    给checkAccount();他一个参数:checkAccount(result);
    这样写就行了。
    如:function checkAccount(result) {
      CheckInfo.checkAccountNo($get("txtAccount").value, $get("txtCode").value, show);
      show(result);
      }
      

  2.   

    如果是asp.net的话,可以加<asp:ScriptManager ID="ScriptManager1" runat="server">指向webservicefunction checkAccount() {
       namespace.CheckInfo.checkAccountNo($get("txtAccount").value, $get("txtCode").value, show);
      

  3.   


    这个是webservice 的内部机制么?参数列表最后一个参数是函数的时候
      

  4.   

    结贴..这是因为 ASP.NET AJAX 中 ScriptManager 的回调函数在起作用..