2013-04-16 58 views
2

我有一个问题,也许它是在这个网站重复,但我找不到它!如何在IE浏览器打开时显示消息?

我希望当用户打开我的IE浏览器中的网页显示此消息

"Please open this website in firefox and you can download Mozilla Firefox from here"

这是怎么回事?

在此先感谢。

+1

的[显示消息,当浏览器不支持的是]可能重复指示符(http://stackoverflow.com/questions/348202/display-a-message-当浏览器不支持) –

+0

http://stackoverflow.com/questions/348202/display-a-message-when-a-browser-is-unsupported –

+1

@Ravindra没有必要再次张贴相同的链接 –

回答

1

如果您喜欢JavaScript,您可以检查的userAgent。

if (navigator.userAgent.indexOf('MSIE')>0) { 
    document.write('do something'); 
}; 

MSIE是为Microsoft Internet Explorer

+0

谢谢,我用你的报价进行了一些更改... –

2

您可以使用条件检查

<!--[if IE]> 
please open this web in firefox and you can download Mozilla Firefox from <a href='here'>here</a> 
<![endif]--> 

或者你可以尝试添加一个js /编程检查

相关问题