I need the browser to download the appropriate script for the client browser.
I need some kind of switch statement that would work?
I have ;
- (common.css) All browsers script need this file
- (ie6.css) IE 6 script
- (ie7.css) IE 7 script
- (ie8.css) IE 8 script
- (ie9.css) IE 9 script
- (other.css) Mozilla + Firefox + Safari use the same for all versions
i have (but doesnt work)
<link rel="stylesheet" href="common.css" type="text/css" />
<!--[if IE 6 ]>
<link rel="stylesheet" href="ie6.css" type="text/css" />
<!--[elseif IE 7 ]>
<link rel="stylesheet" href="ie7.css" type="text/css" />
<!--[elseif IE 8 ]>
<link rel="stylesheet" href="ie8.css" type="text/css" />
<!--[elseif IE 9 ]>
<link rel="stylesheet" href="ie9.css" type="text/css" />
<!--[else]>
<link rel="stylesheet" href="other.css" type="text/css" />
<![endif]-->
Q. Ive hacked the above code from another file but cant get it to work?
If ive got it wrong, is there a better type of switch statement that can be used?
I’m fairly certain that you have to do each condition separately, and not in a switch statement
If not IE