JSON: How do I make cross-domain JSON call

前端 未结 8 916
情歌与酒
情歌与酒 2020-11-30 06:54

I try to run the following jquery code in local Network.

 $.ajax({
     type: \"GET\",
     url: \"http://SomeSite/MyUrl/\",
     cache: false,
     data: {         


        
8条回答
  •  臣服心动
    2020-11-30 07:25

    Due to the same origin policy you can't do this. One workaround is to use the Flash AJAX jQuery plugin http://flxhr.flensed.com/ that uses a Flash movie to bypass the same-origin policy.

    The other options are to proxy the requests through your own domain or use JSONP.

提交回复
热议问题