Browser detection script

Here is a simple browser detection script

<cfif Trim(ListGetAt(CGI.HTTP_USER_AGENT, 2, “;”)) EQ “MSIE 6.0”>

<link rel=“stylesheet”

type=“text/css”

href=“css/main_IE6.css”

media=“screen”

/>

<cfelseif Trim(ListGetAT(CGI.HTTP_USER_AGENT, 2, “;”)) EQ “MSIE 7.0”>

<link rel=“stylesheet”

type=“text/css”

href=“css/main_IE7.css”

media=“screen”

/>

<cfelse>

<link rel=“stylesheet”

type=“text/css”

href=“css/main_FF.css”

media=“screen”

/>

</cfif>

1 comment on this post.
  1. Joe:

    When I copy code from your page it appears that the quotes sign is “curley” instead of straight ones. Is that just a font issue or browser? Can you verify?

    Thanks for the snippet.

Leave a comment