<html>
<head>
<title></title>
</head>
<script language="JavaScript">
<!--
today = new Date()
if(today.getMinutes() < 10){
pad = "0"}
else
pad = "";
document.write ;if((today.getHours() >=6) && (today.getHours() <11)){
document.write("<body background="border1.png" bgproperties=fixed>") //nach 6 Uhr bis 11 Uhr
}
if((today.getHours() >=11) && (today.getHours() <13)){
document.write("<body background="border2.png" bgproperties=fixed>") //nach 11 Uhr bis 13 Uhr
}
if((today.getHours() >=13) && (today.getHours() <18)){
document.write("<body background="border3.png" bgproperties=fixed>") // nach 12 Uhr bis 16 Uhr
}
if((today.getHours() >=18) && (today.getHours() <23)){
document.write("<body background="border4.png" bgproperties=fixed>") //nach 17 Uhr bis 23 Uhr
}
if((today.getHours() >=23) && (today.getHours() <24)){
document.write("<body background="border1.png" bgproperties=fixed>")
}
if((today.getHours() >=0) && (today.getHours() <4)){
document.write("<body background="border1.png" bgproperties=fixed>")
}
if((today.getHours() >=4) && (today.getHours() <6)){
document.write("<body background="border1.png" bgproperties=fixed>")
}
//-->
</script>
</body>
</html>So das ist das skript aber es klappt nicht!!!!
Das kann ja auch nicht klappen. Das ist ganz kaputtes HTML, wo ist das schliessende HEAD?
versuch es mal so:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<script>
var hour = (new Date()).getHours();
var period = parseInt(hour/4);
var back = "border" + period + ".png";
document.write( "<style>\nbody{\nbackground-image: url(" + back + ");\n</style>");
</script>
</head>
<body>
TEST
</body></html>
Struppi.