1、什么是跨域问题
在页面中使用js访问其他网站的数据时,就会出现跨域问题,比如在网站中使用ajax请求其他网站的天气、快递或者其他数据接口时,以及hybrid app中请求数据,浏览器会提 示一下错误:
XMLHttpRequest cannot load http://你请求的域名. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://当前页的域名’ is t