Daniel: random stylesheets

Beitrag lesen

per Java-Skript geht es so:
<html>
<head>
<title></title>
<link id="CSS" rel="stylesheet" type="text/css" href="style.css">
<script>
<!--
function RandomCSS() {
var zufall = Math.random();

if (zufall <= 0.3) {document.getElementById("CSS").href = "style_1.css";
}

else if (zufall > 0.3 && zufall <= 0.6) {document.getElementById("CSS").href = "style_2.css";
}

else if (zufall > 0.6 && zufall <= 1) {document.getElementById("CSS").href = "style_3.css";
}
}
//-->
</script>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000" onLoad=RandomCSS()>
Hallo Welt
</body>
</html>

geht natürlich nur für Browser die das getelementbyid Tag beherrschen beim N 4.7 & < also nicht. N6 kann es aber.