IE6下iframe加载的页面的不显示,要刷新

来源:互联网 发布:faster rcnn 数据 编辑:程序博客网 时间:2024/06/06 02:06

今天在ie6下显示velocity页面中的iframe,发现除了iframe的外框以外,src中请求的url完全没有读取成功,结果是个空的iframe。

代码如下:

var descwin;
function showDescWindow(simcard){
    var url="<%=path %>/pagejsp/sys_manage/maintain/mobileManageDesc.jsp?simCard="+simcard;
    descwin=new Ext.Window({
        layout:'fit',
        closable:true,
        width:700,
        height:470,
        modal:true,
        x:100,
        y:40,
        html:'<iframe id="zhDescwin" name="zhDescwin" src='+url+'  scrolling="auto" frameborder="0" width="100%" height="468"></iframe>',
        title:'移动手机详细',
        renderTo:'descwin'
    });
    if(getIE()=="IE6")
    {
      document.frames('zhDescwin').location.reload();
    }
    descwin.show();
}

<div id="descwin" ></div>

-----------------------------------------------------

var ie="";
function getIE()
{
 if(ie==undefined || ie=="" || ie==null)
 {
  ie=getOs();
  return ie;
 }
 else
 {
  return ie;
 }

}
function getOs() 

   var OsObject = ""; 
   var u = window.navigator.userAgent.toLocaleLowerCase();
   if(u.indexOf("msie")>0) {
     if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/7./i)=="7.")
     {
     //alert("IE 7.0");
     return "IE7";
     }
     else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i)=="8.")
     {
     //alert("IE 8.0");
     return "IE8";
     }
     else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/9./i)=="9.")
     {
     //alert("IE 9.0");
     return "IE9";
     }
     else if(navigator.appName == "Microsoft Internet Explorer")
     {
     //alert("IE 6.0");
     return "IE6";
     }
   }
   if (document.documentMode == 10){
   //alert("IE 10.0");
   return "IE10";
   }
   if(u.indexOf("trident")>0){
   //alert("IE 11.0");
   return "IE11";
   }
   if(u.indexOf("firefox")>0){
     //alert("firefox");
     return "firefox";
   } 
   if(u.indexOf("safari")>0) {
     //alert("safari");
     return "safari";
   }  
   if(u.indexOf("chrome")>0){
     //alert("chrome");
     return "chrome";
   } 
   if(u.indexOf("opera")>0){
     //alert("opera");
     return "opera";
   } 

 

------------------------------------------------------

该方法主要将URL通过iframe形式嵌入到document中,但IE8可正常显示,IE显示空白,而且'zhDescwin' 的src属性为“”,经过漫长的调试,最终通过增加一刷新iframe语句才得以解决:document.frames('zhDescwin').location.reload();
    对于此类BUG的定位实在困难。

 

 

0 0
原创粉丝点击