欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

IE8 下的Js錯(cuò)誤HTML Parsing Error...

 更新時(shí)間:2009年08月14日 02:25:30   作者:  
今天調(diào)試一段JS代碼出現(xiàn)這個(gè)狀況..在火狐 IE7 和IE6下都正常...郁悶,在網(wǎng)上搜索了一下相關(guān)資料 一般錯(cuò)誤都是指所指定的標(biāo)簽沒有加載完就是用該對(duì)象....

網(wǎng)頁錯(cuò)誤詳細(xì)信息

用戶代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; QQDownload 551; SLCC2; .NET CLR 2.0.50727)
時(shí)間戳: Wed, 12 Aug 2009 07:02:03 UTC


消息: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
行: 0
字符: 0
代碼: 0

今天調(diào)試一段JS代碼出現(xiàn)這個(gè)狀況..在火狐 IE7 和IE6下都正常...郁悶,在網(wǎng)上搜索了一下相關(guān)資料 一般錯(cuò)誤都是指所指定的標(biāo)簽沒有加載完就是用該對(duì)象....

檢查了代碼 從表面上看沒有什么問題

如下

<body>

<script language="javascript">

 var bgObj = document.createElement("div"); 
        bgObj.style.cssText = "position:absolute;left:0px;top:0px;width:"+iWidth+"px;height:"+Math.max(document.body.clientHeight, iHeight)+"px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:101;"; 
        document.body.appendChild(bgObj);
</script>
</body>

其實(shí) 仔細(xì)檢查出來就發(fā)現(xiàn) 這段代碼會(huì)在body沒有加載完畢之前運(yùn)行....

問題就出在這里....

所以 代碼只能放在波電壓外面去執(zhí)行

<body>

</body>

<script language="javascript">

 var bgObj = document.createElement("div"); 
        bgObj.style.cssText = "position:absolute;left:0px;top:0px;width:"+iWidth+"px;height:"+Math.max(document.body.clientHeight, iHeight)+"px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:101;"; 
        document.body.appendChild(bgObj);
</script>

這樣OK沒問題了...看來IE 的邏輯性越來越強(qiáng)了.....可能以前很多代碼都會(huì)出現(xiàn)這種問題咯

相關(guān)文章

最新評(píng)論