我有以下web服务;
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
这是现货标准,不会对班级装潢人员做任何改动.
I have this jQuery method;
var webMethod = "http://localhost:54473/Service1.asmx/HelloWorld";
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
data: "{}",
dataType: "json",
url: webMethod,
success: function(msg){ alert(msg.d); },
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(errorThrown);
}
});
It's a post action because later on I need to post data to it.
当我执行jQuery时,我得到一个返回的"No Transport"错误.
我还应该提到的一件事是,jQuery存储在我的机器上的一个简单HTML文件中,并且WebService也在我的机器上运行.
There is no code behind on the HTML page it's simply a web page and not a c# project or anything.
谁能给我指一下正确的方向吗?