關於跨域的那些問題及解決辦法

首先我們先來了解一下跨域到底是什麼,從字面意思來說,就是跨了域名,在不同的域名直接訪問,通信是不通的,具體規則如下圖所示。 跨域解決方案 1、 通過jsonp跨域 2、 document.domain + iframe跨域 3、 location.hash + iframe 4、 window.name + iframe跨域 5、 postMessage跨域 6、 跨域資源共享(CORS) 7、
相關文章
相關標籤/搜索