我爱Aspx >> Asp.Net >> .net 下用javascript调用webservice这里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
Ҷƪл˵?
开发基于ASP.NET WebService的图..[08-01]
开发ASP.NET Atlas服务器端Exten..[08-01]
在ASP.net中保存/取出图片入/从S..[08-01]
调试javascript的好方法[08-01]
.net下访问Access数据库需要注意..[08-01]
用JavaScript打造搜索工具栏[08-01]
IIS同一站点下aps.net 1.1与2.0 ..[08-01]
创建ASP.NET程序时候发生错误&qu..[08-01]
ASP.Net防止刷新自动触发事件的解..[08-01]
ASP.net:Literal控件用法[08-01]
js代码小记(判断textbox的长度,..[08-01]
开发基于ASP.NET WebService的图..[08-01]
六步使用ICallbackEventHandler实..[08-01]
开发ASP.NET Atlas服务器端Exten..[08-01]
在ASP.net中保存/取出图片入/从S..[08-01]
调试javascript的好方法[08-01]
Windows版本Discuz!—EasyDiscuz..[08-01]
Photoshop修图技巧:巧为扫描图像..[08-01]
Photoshop显身手 灌篮高手人人当[08-01]
用Photoshop给照片制作艺术边缘[08-01]