• λ我爱Aspx >> Asp.Net >> .net 下用javascript调用webservice
  • .net 下用javascript调用webservice

  • :aspxer  Դ:5iaspx  :2007-8-1 13:14:02  ؼ:.net,web,webservice,javascript
  • 这里id是我们在div里设置的id,而FridndbyName是我们刚才为方面而起的命,这里就是MyMath了,而CallbackHandler是使用回调函数的过程名,如果无设置的话,则默认是使用onresult所调用的方法来进行处理,下文会讲到,而param1,,param2等则是说传入的参数了,如:

    <SCRIPT language="JavaScript">

    // All these variables must be global,

    // because they are used in both init() and onresult().

    var iCallID = 0;

    var intA = 5;

    var intB = 6;

    function init()

    {

    // Establish the friendly name "MyMath" for the WebServiceURL

    service.useService("/services/math.asmx?WSDL","MyMath");

    // The following method doesn't specify a callback handler, so onWSresult() is used

    iCallID = service.MyMath.callService("add", intA, intB);

    }

    function onWSresult()

    {

    // if there is an error, and the call came from the call() in init()

    if((event.result.error)&&(iCallID==event.result.id))

    {

    // Pull the error information from the event.result.errorDetail properties

    Ҷƪл˵?
  • һƪWindows XP巧妙关闭USB错误提示的方法
    һƪjs代码小记(判断textbox的长度,并且固定最多收入字符)