“internet explore 無(wú)法打開(kāi)internet站點(diǎn) 已終止操作”的解決方法
更新時(shí)間:2008年04月12日 23:50:35 作者:
在IE下,當(dāng)頁(yè)面還沒(méi)有加載完全時(shí),如果正在執(zhí)行的JS代碼中含有使用了document.createElement的話,很容易引起頁(yè)面加載失敗.導(dǎo)致提示"internet explore 無(wú)法打開(kāi)internet站點(diǎn) http://www.xxx.com/xxx/xxx.html 已終止操作".
這是因?yàn)?
在IE下,在加載文檔的過(guò)程中,整個(gè)HTML文檔的DOM結(jié)構(gòu)尚未生成完整,而此時(shí)正在執(zhí)行的JS就已創(chuàng)建出新的DOM結(jié)點(diǎn)了,致使DOM樹(shù)的結(jié)構(gòu)發(fā)生紊亂.
易出錯(cuò)寫法:
復(fù)制代碼 代碼如下:
<html>
<head>
<title> xxxxxxxxxxxx </title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="楓巖,CNLEI" />
<meta name="copyright" content="cnlei.y.l@gmail.com , http://www.cnlei.com" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
xxxxxxxxxxxxxxxxxx
<script type="text/javascript">
<!--
(function init(){
$WIN().create({//創(chuàng)建復(fù)雜HTML結(jié)構(gòu)
id:"lWindow_Reg",
title:"注冊(cè)新用戶",
type :"AJAX",
innerHTML:'ex_reg.html'
},{
top:"50px",
left:"270px",
width:"560px"
});
})();
-->
</script>
xxxxxxxxxxxxxxxxxx
</body>
</html>
解決方法:
復(fù)制代碼 代碼如下:
<html>
<head>
<title> xxxxxxxxxxxx </title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="楓巖,CNLEI" />
<meta name="copyright" content="cnlei.y.l@gmail.com , http://www.cnlei.com" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
xxxxxxxxxxxxxxxxxx
<script type="text/javascript">
<!--
(function(){
function init(){
$WIN().create({//創(chuàng)建復(fù)雜的HTML結(jié)構(gòu)
id:"lWindow_Reg",
title:"注冊(cè)新用戶",
type :"AJAX",
innerHTML:'ex_reg.html'
},{
top:"50px",
left:"270px",
width:"560px"
});
};
if(!DWS.BV.isIE){//非IE瀏覽器直接初始化
init();
} else {
//IE下,防止瀏覽器提示“internet explore 無(wú)法打開(kāi)internet站點(diǎn) 已終止操作”
if (document.readyState=="complete"){
init();
} else {
document.onreadystatechange=function(){
if(document.readyState=="complete")init();
}
}
}
})();
-->
</script>
xxxxxxxxxxxxxxxxxx
</body>
</html>
相關(guān)文章
加載flash9.ocx出現(xiàn)錯(cuò)誤的解決方法
用IE瀏覽網(wǎng)頁(yè)時(shí),經(jīng)常會(huì)遇到flash9插件加載錯(cuò)誤。如果選擇繼續(xù),則CPU被占用90%以上幾秒后,網(wǎng)頁(yè)自動(dòng)關(guān)閉。如果把flash9.ocx關(guān)掉,不加載的話,flash又看不成。2008-04-04自己動(dòng)手做DVD壓縮盤的方法與相關(guān)軟件下載
自己動(dòng)手做DVD壓縮盤的方法與相關(guān)軟件下載...2007-03-03終于明白了tc編譯的dos程序和vc編譯的win32控制臺(tái)程序的區(qū)別
終于明白了tc編譯的dos程序和vc編譯的win32控制臺(tái)程序的區(qū)別...2007-09-09使用電腦多年來(lái)的一些實(shí)用小經(jīng)驗(yàn)
這篇文章主要介紹了使用電腦多年來(lái)的一些實(shí)用小經(jīng)驗(yàn)2007-02-02不要再喊“誰(shuí)給我一個(gè)身份證號(hào)碼驗(yàn)證的代碼”了,腳本之家站長(zhǎng)提供了
不要再喊“誰(shuí)給我一個(gè)身份證號(hào)碼驗(yàn)證的代碼”了,腳本之家站長(zhǎng)提供了...2007-12-12遠(yuǎn)程開(kāi)機(jī)詳細(xì)說(shuō)明
遠(yuǎn)程開(kāi)機(jī)詳細(xì)說(shuō)明...2007-06-06