今天设置静态资源服务器时发现 Font from origin 'http://start.fbzl.org' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://lib.fbzl.org' is therefore not…
跨域是前端开发中经常会遇到的问题,前端调用后台服务时,通常会遇到 No 'Access-Control-Allow-Origin' header is present on the requested resource的错误,这是因为浏览器的同源策略拒绝了我们的请求.所谓同源是指,域名,协议,端口相同,浏览器执行一个脚本时同源的脚本才会被执行.如果非同源,那么在请求数据时,浏览器会在控制台中报一个异常,提示拒绝访问. 跨域是指a页面想获取b页面资源,如果a.b页面的协议.域名.端口.子域名不…