这是我的代码
$.ajax({
url: "http://localhost:42046/WebService1.asmx/HelloWorld",
type: 'get',
success: function (data) {
$("#fillme").html(data);
}
});
当我删除$("#fillme").html(data);
错误时。
html
<span id="fillme"></span>
似乎问题出在从Web服务解析xml。如果仅http://localhost:42046/WebService1.asmx/HelloWorld
在浏览器中执行,您将看到它。我建议您检查一下您的Web服务,并使其以正确的格式返回数据(我不确定您到底需要什么,但看起来像字符串)。还要尝试更改$.ajax
参数(api.jquery.com/jQuery.ajax),请注意contents
,converters
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句