javascript如何同步调用webservice?
网上看到一个javascript调用webservice的例子,使用微软的webservice.htc文件,不过代码是异步的,哪位大侠修改一下,把它改成同步的。谢谢!
代码如下:
<HTML>
<HEAD>
<title>例子 </title>
<script language="javascript">
function doMul()
{
service.useService("Multi.asmx?wsdl","DoMultiService");
var parm1 = Form1.all.mul1.value;
var parm2 = Form1.all.mul2.value;
service.DoMultiService.callService(callback,"DoMulti",parm1,parm2);
}
function callback(result)
{
if (!result.error)
{
Form1.all.retValue.value=result.value;
}
else
{
Form1.all.retValue.value=result.errorDetail.string;
}
}
</script>
</HEAD>
<body>
<div id="service" style="BEHAVIOR:url(webservice.htc)"> </div>
<form id="Form1" method="post" runat="server">
<FONT face=宋体>
<INPUT type=text id=mul1 name=mul1>* <INPUT type=text id=mul2 name=mul2>
<INPUT style="WIDTH: 50px" onclick=doMul() type=button value="=">
<INPUT type=text id=retValue name=retValue>
</FONT>
</form>
</body>
</HTML>
------解决方案--------------------噢~又是这问题
------解决方案--------------------
http://www.cnblogs.com/think8848/archive/2008/04/03/1136176.html
------解决方案--------------------up
------解决方案--------------------学习中......
------解决方案--------------------up
------解决方案--------------------友情up
------解决方案--------------------
------解决方案--------------------javascript 好像只能调用本地的WEBSERVICE 啊,感觉没什么意义啊,直接用ajax实现好了