摘要:
有时我们在请求数据接口时,会看到控制台中出现如下错误信息:
XMLHttpRequest cannot load http://server.runoob.com/server.php. No 'Access-Control-Allow-Origin' header is present on the requested
resource.Origin 'http://client.runoob.com' is therefore not allowed access.
这句话意思说不能请求到资源;
如果客户端请求其他服务器的资源时我们设置一下跨域;下面演示设置:
1.用php的方法在脚本中添加如下代码:
//允许单个域名访问 阅读全文
posted @ 2019-01-03 09:42
青丝南开
阅读(1052)
评论(0)
推荐(1)

浙公网安备 33010602011771号