Sunday March 16, 2008

   restrict IE users from hitting your website

I can't remember where I got this from, but its something I wanted to use on here because quite frankly, I don't think I know one user who uses IE. And to those that do, the question has to be asked... why???

Anyway, here is a sexy script that you can put in your header to stop IE users from infecting your site with their nonsensical nonsense.

<script language="javascript">
    <!--
    if (navigator.appName == "Microsoft Internet Explorer") {
        document.location = "http://<%= request.host_with_port %>/noie"; 
    }
    // -->
</script>


Too Simply? BTW: This is obviously being used with rails, change the document.location to a url, and you'll be hating on the blue e in no time



Back