本文共 478 字,大约阅读时间需要 1 分钟。
在近期的项目中遇到一个浏览器跨域访问的问题,这个项目是跟第三方厂商合作进行开发,我们负责后台的业务功能实现,而前端页面展示由第三方厂商来实现,为了调试后台的业务接口,我开发过程中按照如下的接口进行调用测试,发现一直出现跨域禁止访问的提示。(注意:开发过程中使用谷歌浏览器)。
请求测试页面:
后来参考如下两篇文档进行解决的,在这里分享下供大家参考:我的视光师
1.http://blog.csdn.net/ziwoods/article/details/51062206 2.http://blog.csdn.net/rapier512/article/details/51506672 注意,在第一篇文章中配置好谷歌浏览器后(--args --disable-web-security --user-data-dir),首先要先打开谷歌浏览器会出现如下所示的图片:
打开谷歌浏览器后在去打开如上的html页面即可(一定不要直接用谷歌浏览器去打开html页面)。