如何在远程服务器上使用jquery调用webservice?
问题描述:
我创建了一个html页面,其中使用jquery调用了webservice.
它可以在本地工作,但在远程服务器上则不能工作.
这是javascript
中使用的代码
I have created one html page,in that using jquery i have call webservice .
It will work locally ,but on remote server it can not works.
This is the code using in javascript
$.ajax({
type: "POST",
url: "http://example.com/test.asmx/helloworld",
data: "{'bannerid':'" + id + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
//$(divid1).removeClass('loading');
$(divid1).html(msg)
}
});
答
.ajax({ 类型:" , 网址:" , 数据:"
.ajax({ type: "POST", url: "http://example.com/test.asmx/helloworld", data: "{'bannerid':'" + id + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { //
(divid1).removeClass('loading');
(divid1).removeClass('loading');
(divid1).html(msg) } });
(divid1).html(msg) } });