jQuery Call to WebService returns “No Transport” error

前端 未结 8 1659
渐次进展
渐次进展 2020-11-22 15:19

I have the following web service;

    [WebMethod]
    public string HelloWorld()
    {
        return \"Hello World\";
    }

It\'s stock st

8条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 15:48

    If your jQuery page isn't being loaded from http://localhost:54473 then this issue is probably because you're trying to make cross-domain request.

    Update 1 Take a look at this blog post.

    Update 2 If this is indeed the problem (and I suspect it is), you might want to check out JSONP as a solution. Here are a few links that might help you get started:

    • https://en.wikipedia.org/wiki/JSON
    • http://remysharp.com/2007/10/08/what-is-jsonp/
    • http://www.west-wind.com/weblog/posts/107136.aspx

提交回复
热议问题