“internet explore 無法打開internet站點 已終止操作”的解決方法
更新時間:2008年04月12日 23:50:35 作者:
在IE下,當頁面還沒有加載完全時,如果正在執(zhí)行的JS代碼中含有使用了document.createElement的話,很容易引起頁面加載失敗.導致提示"internet explore 無法打開internet站點 http://www.xxx.com/xxx/xxx.html 已終止操作".
這是因為:
在IE下,在加載文檔的過程中,整個HTML文檔的DOM結構尚未生成完整,而此時正在執(zhí)行的JS就已創(chuàng)建出新的DOM結點了,致使DOM樹的結構發(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)建復雜HTML結構
id:"lWindow_Reg",
title:"注冊新用戶",
type :"AJAX",
innerHTML:'ex_reg.html'
},{
top:"50px",
left:"270px",
width:"560px"
});
})();
-->
</script>
xxxxxxxxxxxxxxxxxx
</body>
</html>
解決方法:
復制代碼 代碼如下:
<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)建復雜的HTML結構
id:"lWindow_Reg",
title:"注冊新用戶",
type :"AJAX",
innerHTML:'ex_reg.html'
},{
top:"50px",
left:"270px",
width:"560px"
});
};
if(!DWS.BV.isIE){//非IE瀏覽器直接初始化
init();
} else {
//IE下,防止瀏覽器提示“internet explore 無法打開internet站點 已終止操作”
if (document.readyState=="complete"){
init();
} else {
document.onreadystatechange=function(){
if(document.readyState=="complete")init();
}
}
}
})();
-->
</script>
xxxxxxxxxxxxxxxxxx
</body>
</html>
相關文章
終于明白了tc編譯的dos程序和vc編譯的win32控制臺程序的區(qū)別
終于明白了tc編譯的dos程序和vc編譯的win32控制臺程序的區(qū)別...2007-09-09不要再喊“誰給我一個身份證號碼驗證的代碼”了,腳本之家站長提供了
不要再喊“誰給我一個身份證號碼驗證的代碼”了,腳本之家站長提供了...2007-12-12