默认情况下ajax请求是有同源策略,限制了不同域请求的响应. 例子:http://localhost:23160/HtmlPage.html 请求不同源API http://localhost:22852/api/values, What is "Same Origin"? Two URLs have the same origin if they have identical schemes, hosts, and ports. (RFC 6454) These two URLs h
这两天在做关于读取json数据的插件,想用getJSON读取数据: $.getJSON(http://www.xxxx.com/Titles.js, function (data) { console.log(data); }); 出现一下文字 XMLHttpRequest cannot load http://www.xxxx.com/Titles.js. Origin http://my.xxxx.com is not allowed by Access-Control-Allow-Orig