Josh Bird came up with a method of switching CSS pages using Javascript. This may not work in all browsers, but it seems fine so far.
Note that the web address remains the same, with the exception of the css being used.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="javascript">
<!--
var url = window.location.href;
var cssLoc = url.indexOf("?css=");
var cssSelect;
var file;
if (cssLoc != -1) {
cssSelect = url.substr(cssLoc + 5);
switch (cssSelect) {
case '1': file = "style1.css"; break;
case '2': file = "style2.css"; break;
case '3': file = "style3.css"; break;
}
} else {
file = "default.css";
}
document.writeln('<link href="' + file + '" rel="stylesheet" type="text/css">')
-->
</script>
</head>
<body>
<p><a href="test.html?css=1">Style 1</a> | <a href="test.html?css=2">Style 2</a> | <a href="test.html?css=3">Style 3</a> | <a href="test.html">default </a></p>
<p>CSS Changes</p>
</body>
</html>
|