您的位置:首页 > 其它

“internet explore 无法打开internet站点 已终止操作”的解决方法

2018-10-12 13:56 906 查看

这是因为:
在IE下,在加载文档的过程中,整个HTML文档的DOM结构尚未生成完整,而此时正在执行的JS就已创建出新的DOM结点了,致使DOM树的结构发生紊乱.

易出错写法:

<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({//创建复杂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({//创建复杂的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> 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐