一直以为safari很垃圾,没想到这么人性。
问题:本地写了个html,访问了一个网站的ajax请求。
报错如下:
[Error] Origin null is not allowed by Access-Control-Allow-Origin.
[Error] XMLHttpRequest cannot load https://www.baidu.com/ due to access control checks.
[Error] Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. (www.baidu.com, line 0)
原因:跨域了。
网友评论