E-com DevBlog Spider-ball-vacuum

29Oct/080

JavaScript Conditional Compilations

I don't think it's any secret amongst Team Awesome or it's affiliates that I hate IE (in fact I'm pretty sure we all do) and more specifically I hate IE6, so everytime we code a new site I'm all for not supporting IE6, my motto...."punish the IE6 losers, I mean users, I mean losers" but I'm far from getting my way. Even though it appeared I might with NT2.2, ultimatley I was defeated. And it's kinda sad to because if we got away from that more than half of those who are still on IE6 would upgrade because they would realize they are behind. Anyhow in an effort to find a polite way to explain to those poor suckers that there are better more advanced browsers out there I found a way to use JavaScript to detect the javascript version of the users browser and if that version matches IE6 display a single alert box to inform them of their folley. Sure there are other ways but I found this one kinda interesting.

?View Code JAVASCRIPT
<script type="text/javascript">
/*@cc_on
	/*@if(@_jscript_version < 5.7)
		alert('We have detected that you are using an older browser, for a better user experience please upgrade your browser to IE7 or something totally better altogether like Firefox or Safari, or even Chrome or the PS3 browser for crying out loud.');
	@end
@*/
</script>

for more information on Conditional Compilations go Here

For more informatoin on the PS3 Browser go Here

Print This Post Print This Post