重定向第一次請求跨域,仍能夠發送第二次請求
第二次請求服務器端可正常運行,客戶端將沒法接受到數據。
以下是遇到此問題時的一些能夠觀察到的表現:javascript
<select multipe id="s" name="s"> <option value="1">1</option> <option value="2">2</option> </select>
s.onchange = function () { console.log(Array.prototype.map.call(this.options, (item) => { return return item.value + 'is selected: ' + item.selected }).join('\n')) }
<script> document.write("寫在頂層,這樣腳本在解析階段就會執行!") // ok document.documentElement.onclick = () => { document.write('點擊了頁面,調用write寫入新內容,原有內容將被清空') } </script>
如下代碼展現瞭如何關閉當前瀏覽頁面:html
const closeWebPage = () => { if (navigator.userAgent.indexOf('MSIE') > 0) { if (navigator.userAgent.indexOf('MSIE 6.0') > 0) { window.opener = null window.close() } else { window.open('', '_top') window.top.close() } } else if (navigator.userAgent.indexOf('Firefox') > 0 || navigator.userAgent.indexOf('Chrome') > 0) { window.location.href = 'about:blank' window.close() } else { window.opener = null window.open('', '_self') window.close() } }
父頁面:java
<body> <iframe src="./frame.html" frameborder="0" id="frame"></iframe> </body> <script> var p = Object.prototype var o = Object </script>
內嵌頁面frame:web
<body> frame content </body> <script> var frameP = Object.prototype console.log(frameP) // {constructor: ƒ, __defineGetter__: ƒ, …} var parentP = window.parent.p console.log(parentP) // {constructor: ƒ, __defineGetter__: ƒ, …} console.log(frameP === parentP) // false var frameO = Object console.log(frameO) // ƒ Object() { [native code] } var parentO = window.parent.o console.log(parentO) // ƒ Object() { [native code] } console.log(frameO === parentO) // false </script>