博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ajax post 跨域访问开发调试
阅读量:4136 次
发布时间:2019-05-25

本文共 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页面)。

你可能感兴趣的文章
Leetcode—283Move Zeroes
查看>>
Leetcode-25 Reverse Nodes in k-Group
查看>>
Leetcode——209. Minimum Size Subarray Sum
查看>>
Leetcode——29. Divide Two Integers
查看>>
Leetcode——30. Substring with Concatenation of All Words
查看>>
全排列生成算法:next_permutation
查看>>
Leetcode——31. Next Permutation
查看>>
Leetcode——216. Combination Sum III
查看>>
Leetcode——228. Summary Ranges
查看>>
Leetcode——229. Majority Element II
查看>>
Leetcode——1. Two Sum
查看>>
Leetcode——36. Valid Sudoku
查看>>
Leetcode——350. Intersection of Two Arrays II
查看>>
isstringstream——WOW!Amazing!
查看>>
Leetcode——290. Word Pattern
查看>>
Leetcode——299. Bulls and Cows
查看>>
Leetcode——136. Single Number
查看>>
Leetcode——237. Delete Node in a Linked List
查看>>
Leetcode——396. Rotate Function
查看>>
KMP算法最浅显理解——一看就明白
查看>>