后端是用eclipse开发的java后台,前端使用webstorm,前端html文件中通过ajax请求
后台接口,由于后台和前端共用一个端口没发同时访问,所以我修改了eclipse的端口为8088,webstorm的端口为8080,。然后在html中通过ajax请求后台接口地址Http://localhost:8088/test/user.json;ajax一直走失败的方法,在浏览器错误Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://10.20.153.16:8080' is therefore not alloed access.请大神们帮忙看下怎么解决
ajax如何解决跨域问题?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-