admin管理员组文章数量:1558103
今天在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的定位实在困难。
版权声明:本文标题:IE6下iframe加载的页面的不显示,要刷新 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1727374926a1111594.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论