|
|
類型:js_article JavaScript使IE的經典異常 代碼網頁這是兩個經典異常,不知道原理的話很難定位。從下面的代碼中可用看到發生的條件 <iframe src="java, not allowed, script:'<script>top.ff1={abc:function(){}}<\/script>'" width=0 height=0 name="f1"></iframe>
<button onclick="f1.location='about :blank';settimeout('alert(ff1.abc())',0)">不能執行已經釋放的代碼</button> <iframe src="java, not allowed, script:'<script>top.ff2={abc:function(){}}<\/script>'" width=0 height=0 name="f2"></iframe> <button onclick="f2.location='about :blank';settimeout('alert(ff2.tostring())',0)">意外地調用了方法或屬性訪問</button> p標籤的innerhtml不能插入center標記: <p onclick="innerhtml='<center></center>'"><button>未知的運行時錯誤</button></p>
下面這個是經典的「無法打開internet站點」異常: <div><div><script>document.getelbentbyid("tt").innerhtml=""</script></div></div>
從這些例子可以看到ie的健壯性還是有挺大的提升餘地的。 |
|
104休閒信箱 2.3.0 © 104mm.com 2001 - 2021. | 您尚未登錄 |