`
xunmengsj
  • 浏览: 9921 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论
文章列表
比如http://serverIp:8051/test/index.html页面需要需要访问本地启动的Server,http://localhost:8089/api/heren-plugin/event,这时会存在跨域的问题,解决方案有jsonp和iframe等,但jsonp只能使用get方法调用,没有post,在大数据传输时get方法显然不适合。最好的办法就是在目标域的项目中写一个Filter,如下: public class HerenCorsFilter implements Filter {     @Override     public void doFilter(S ...
众所周知,jsonp可以解决跨域问题,下面是我在查阅资料和实际项目使用后的一些总结。 Jquery中jsonp的使用 myUrl = "http://localhost:8090/api/test"; $.ajax({   type:"GET",   url:myUrl,   dataType:"jsonp",   jsonp:"callback",   jsonpCallback:"jsonpCallback",   success:function(data){ ...
Global site tag (gtag.js) - Google Analytics