.htaccess添加下面代码:
<IfModule mod_headers.c> Header add Access-Control-Allow-Origin "*" </IfModule>
web.config设置下面代码:
.... <system.webServer> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> </customHeaders> </httpProtocol> </system.webServer> .... 本文转自黄聪博客园博客,原文链接:http://www.cnblogs.com/huangcong/p/5403866.html,如需转载请自行联系原作者