我有一个Web服务
,它将返回一个值。我的要求是,我需要从一个名为index.html
的页面调用该Web服务
,该页面上有一个HTML提交按钮。在点击按钮时,我会调用JavaScript
函数,然后我想调用Web方法。我该如何实现。
我的Web服务地址是"localhost/ws/service.asmx"
,Web方法是HelloWorld
<input type="button" value="Submit" id="btn_submit" onclick ="return fun()">
function fun() {
// here I want to call the "helloworld" method.
return true;
}
return "你好,世界"; }
这是我的方法...一个简单的方法。 - ocp