前端跨域的几种方案

97 阅读1分钟

1.JSONP

2.CORS

3.nginx

4.nodejs中间件

5. document.domain + iframe跨域

6. location.hash + iframe跨域

7.window.name + iframe跨域

8.postMessage跨域

9.WebSocket协议跨域

这里只介绍的几种方式,详情用法待作者一一试用在详细解答