Ive made a simple Javascript Function that will swap the CSS source file, and change the page properties, The Code works in Mozilla2, and swaps the page but in IE7 it doesn’t work, Im pretty Sure it works in IE6, was testing it yesterday. I placed alert() messages around to show the css reference which works in mozilla but not IE7 in IE it shows nothing at all not even the original reference.
Code Below
<head>
<script language=”JavaScript” type=”text/JavaScript”>
function Swap(Path) {
alert(document.getElementById(‘Design’).innerHTML);
document.getElementById(‘Design’).innerHTML='<link rel=”stylesheet” type=”text/css” href=”CSS/’+Path+'” /><!–[if IE 6]><link rel=”stylesheet” type=”text/css” href=”CSS/ie6’+Path+'”/><![endif]–><!–[if IE 7]><link rel=”stylesheet” type=”text/css” href=”CSS/ie7’+Path+'” /><![endif]–>’;
}
</script>
<div id=”Design”>
<link rel=”stylesheet” type=”text/css” href=”CSS/Tourism.css” />
<!–[if IE 6]>
<link rel=”stylesheet” type=”text/css” href=”CSS/ie6Tourism.css” />
<![endif]–>
<!–[if IE 7]>
<link rel=”stylesheet” type=”text/css” href=”CSS/ie7Tourism.css” />
<![endif]–>
</div>
</head>