<html>
<head>
<title>Edit</title>
<script language="JavaScript" type="text/javascript">
var iCallID;
function init(){
service.useService("ajax.asmx?WSDL","servicename");
}
function StartRequest(){
iCallID = service.servicename.callService(myCallBackFunction, "HelloWorld");
}
function myCallBackFunction(res){
if (!res.error) {
alert(res.value);
}
else{
alert(res.errorDetail.string);
}
}
</script>
</head>
<body οnlοad="init()">
<font face="宋体"></font>
<br>
Enter a Value <input type='text' id='param1'>
<br>
<button οnclick='StartRequest()' type="button">Call A Web Method</button>
<div id="service" style="BEHAVIOR:url(webservice.htc)">
</div>
</body>
</html>
JavaScript调用Web Services(仅支持IE)
最新推荐文章于 2024-09-13 08:33:26 发布