Reputation: 1764
I have a web site that is just anything but functional with IE8. I currently have the web site displaying a banner that takes the visitor to upgrade IE. I'd like to do more...
What I'd like to do is, display that banner in addition to a message that says something like "Sorry your browser does not meet the requirements to view this site". I don't want it to load any other page content.
Is there a way to say don't load the rest of the page in the IE if statement?
<!--[if lt IE 8]>
<div style=' clear: both; text-align:center; position: relative;'>
<a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"><img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /></a>
</div>
-- Here is where I want to say DON'T LOAD ANYTHING ELSE.
-- Maybe automatically redirect to another blank page?
<![endif]-->
Upvotes: 1
Views: 1101
Reputation: 5213
<!--[if lte IE 8]>
<div style=' clear: both; text-align:center; position: relative;'>
<a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"><img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /></a>
</div>
<![endif]-->
<!--[if gt IE 9]-->
Here's where IE 9+ content goes (as well as content for any other browser).
<!--[endif]-->
Edited as per Juhana's suggestions below.
Upvotes: 1
Reputation: 33163
The basic structure for such a document:
<body>
<!--[if lte IE 8]
<div style=' clear: both; text-align:center; position: relative;'>
<a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"><img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /></a>
</div>
<![endif]-->
<!--[if gt IE 8] -->
The rest of the document goes here.
All browsers except IE 8 and below parse this.
..content...
Rigth at the end close the conditional.
<!-- <![endif]-->
</body>
</html>
Note that it should be lte IE 8
to exclude version 8.
Upvotes: 2
Reputation: 175766
If you really need to do this, in the head
:
<!--[if lt IE 8]>
<meta http-equiv="refresh" content="0;url=i_should_fix_this_for_ie8.html">
<![endif]-->
Upvotes: 1
Reputation: 194
Really you could do something javascript to hide the page, such as hiding the content, or placing a div over it, but the best thing to do would be to just let the user view the page regardless of how messed up it is. Many people are often stuck using old web browsers, and this is especially true on corporate networks. So those people may be unable to view your page at all if you do this.
Upvotes: 0