前端实现跨域的方法

1.jsonp
2.cors (node服务端设置)
3.postMessage (iframe通信)
4.window.name (iframe通信,a,b页面同源,c不同源; c将值放在window.name中,a页面中iframe嵌套c,然后在将iframe的地址改为b,b页面也可以使用window.name了)
5.location.hash(利用iframe中url值带hash值)
6.http-proxy
7.nginx
8.websocket
9.documnet.domain

猜你喜欢

转载自blog.csdn.net/weixin_44441196/article/details/122800821