Sebastian: random css <ns 5

Beitrag lesen

Hi Loser
Leider funktioniert das StyleSheet nicht ganz ohne dieses Tag, wobei ich hier deine Frage nicht ganz verstehe. Bei mir funktioniert dieses Script unter NS4.7 unter folgendem Zustand:

In den CSS-Datei (mit verschiedenen Schriftangaben, hier nur ein Beispiel):

#MusterID{
font-family: Arial;
}

.MusterCLASS{
font-family: Arial;
}

In der HTML-Datei:
<html>
<head>
<title></title>

<script language="JavaScript">
 <!-- random css url

function RandomCSS() {
 var zufall = Math.random();
 if (zufall <= 0.3) {document.write("<link rel='stylesheet' type='text/css' href='001.css'>");

else if (zufall > 0.3 && zufall <= 0.6) {document.write("<link rel='stylesheet' type='text/css' href='002.css'>");

else if (zufall > 0.6 && zufall <= 1) {document.write("<link rel='stylesheet' type='text/css' href='003.css'>");
 }

// -->
</script>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000" onLoad=RandomCSS()>
<p id="MusterID">Hallo Welt</p>
<p class="MusterCLASS">hallo</p>
</body>
</html>

Wo hast du das Script eigentlich genau her?