Accessing web Service from jQuery - cross domain

前端 未结 4 581
广开言路
广开言路 2020-11-30 00:52

I am trying to acess a wcf service from a jQuery client

Specifically this example http://www.codeproject.com/KB/aspnet/WCF_JQUERY_ASMX.aspx#4

All works well

4条回答
  •  半阙折子戏
    2020-11-30 01:13

    Typically, you won't be able to; modern browsers restrict this to prevent cross-site scripting attacks. One way around it may be to use "padded" JSON, JSONP, which inserts the results in a script element on your page. There's a Microsoft WCF sample here which seems to do that.

提交回复
热议问题