Javascript如何调用webservice
我下载了webservice.htc放到与网页同目录,使用样式属性把Web服务行为附加到HTML元素里
<script>
function onLoad() {
addservice.useService("WebService_projectmap.asmx?WSDL", "prjmap");
}
</script>
<body onload="onLoad()">
<div id="addservice" style="behavior: url(webservice.htc)" mce_style="behavior: url(webservice.htc)">
</body>
到了addservice.useService("WebService_projectmap.asmx?WSDL", "prjmap");这步在浏览器中F12查看就有错误:
Uncaught TypeError: Object #<HTMLDivElement> has no method 'useService'
什么原因呢?我用的.Net Frameword2.0