我已经使用HTML 5编写了一个应用程序,并且当有人从IE访问时,我不想显示错误框而不是页面。当它检测到navigator.appName
为Microsoft Internet Explorer
时,它隐藏所有内容并显示开始隐藏的错误div。股利如下:IE不呈现div内容
<div id='ieerror' style='display:none;width:500px;height:500px;border:3px solid #ff0000;position:absolute;top:50%;left:50%;margin-top:-250px;margin-left:-250px;'>
<center>
<h1 style='font-size: 30px;'>Internet Explorer is not supported by Aud!</h1><br /><br />
<p>Internet Explorer does not support HTML 5 and therefore this application cannot run.<br />
Please upgrade your browser. We suggest <a href='http://www.google.com/chrome'>Google Chrome</a>!</p>
</center>
</div>
的问题是,当我访问在IE页面中,DIV与边框弹出,但没有内容。它里面什么都没有。我去了view->source
看着它,代码仍然存在,但没有渲染。我该如何解决?
这是ASP .net/php吗?如果是这样,你可以使用请求头来确定浏览器,如果它是IE只是发送一个错误页面。 – Russell 2010-04-01 03:25:10
另外,根据下面的注释,PO提到IE8中会出现这个问题。不确定这是否适用于其他版本的IE。 – Russell 2010-04-01 03:38:18