Well, the final compact format was of my own creation, but I got guidance along the way from Stu and the Javascript Kit page (both linked in the post).
Thursday, February 26, 2009 9:23:00 AM
IE browsers support Conditional Comments, but the syntax only supports IF statements – there is no ELSE. Stu Nicholls and the JavaScript Kit to the rescue; the following simulates an else statement: <html>
<head><title>Choose a browser...</title></head>
<body>
<p>You chose
<![if ! IE]>
wisely
<![endif]><!--[if IE]>
poorly
<![endif]-->
...</p>
</body>
</html>
Copy to a text file, save as html and run in IE and Firefox/Chrome/Safari/Opera…
posted by Oskar Austegard at 9:13 PM on Feb 25, 2009
"HTML: Conditional Else Comment"
2 Comments -
interesting snippit. where'd you come across this one?
Thursday, February 26, 2009 8:22:00 AM
Well, the final compact format was of my own creation, but I got guidance along the way from Stu and the Javascript Kit page (both linked in the post).
Thursday, February 26, 2009 9:23:00 AM