如何解决ajax跨域问题
2个回答
展开全部
用jsonp或者在服务端设置允许跨域
response.addHeader("Access-Control-Allow-Origin", "*");
response.addHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
response.addHeader("Access-Control-Allow-Headers", "Origin, No-Cache, X-Requested-With, If-Modified-Since, "
+ "Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With");
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询