注意:仅 IE 10 Beta 版本才会出现此问题
场景:
a.html有showModalDialog来打开b.html:
window.showModalDialog(b.html, self, 'dialogHeight=800px;dialogWidth=900px');
b.html 中有框架集:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="somefile.aspx.vb">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<HTML>
<HEAD>
Some Title
</TITLE>
</HEAD>
<frameset rows="40px,*" border="0" frameSpacing="0" frameBorder="0">
<frame src="myfile.aspx" noresize height="100%" width="100%" scrolling="no">
</frameset>
</HTML>
问题: 当我尝试使用 a.html 中的 window.showModalDialog 打开 b.html 时,尽管我给出了dialogHeight 和dialogWidth,但弹出窗口出现在一个小窗口中。仅 IE10 才会出现这种情况。我正在使用测试版。请帮忙。
最佳答案
我已经能够通过指定document compatibility mode来解决这个问题。在framesest页面中:
<meta http-equiv="x-ua-compatible" content="IE=7" >
关于internet-explorer-10 - IE 10 Beta - 打开其中包含框架集的窗口时,window.showModalDialog 会忽略dialogHeight 和dialogWidth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12928745/