Cross-site ajax call to a WCF Service

前端 未结 4 1461
陌清茗
陌清茗 2021-02-06 18:09

Is it possible to do a cross-site call, in Javascript, to a WCF service?

I don\'t mind if it\'s a POST or a GET.

But I\'ve heard that these days, browsers don\'t

4条回答
  •  礼貌的吻别
    2021-02-06 18:27

    Are you using jQuery by any chance? jQuery supports Cross-Domain JSON requests using "JSONP". You will be limited to GET requests, but I've tried it out and it works well! It's also very simple to get working.

    See the "Cross-Domain getJSON (using JSONP) " section on this page for details: http://docs.jquery.com/Release:jQuery_1.2/Ajax

    And here's some background on JSONP: http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/

    Let me know how it goes!

提交回复
热议问题