普通网友 2017-08-21 09:23 采纳率: 0%
浏览 2562

ajax如何解决跨域问题?

后端是用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.请大神们帮忙看下怎么解决

  • 写回答

5条回答 默认 最新

  • threenewbee 2017-08-21 09:48
    关注
    评论

报告相同问题?