重定向第一次请求跨域,仍能够发送第二次请求
第二次请求服务器端可正常运行,客户端将没法接受到数据。
以下是遇到此问题时的一些能够观察到的表现: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>