Uhrzeit, Datum und Text in der Statuszeile

Zeigt Datum, Uhrzeit und einen beliebigen Text in der Statusleiste des Browsers an.

Fügen Sie diesen Code im Head-Bereich der Seite ein und passen Sie die Texte an:

<script type="text/javascript"> 
<!-- Begin
var osd = " "
osd +="Sachen-fuer-Webmaster.de ";
osd +="In diese Zeilen kommt Ihr Text";
osd +=" ";
var timer;
var msg = "";
monthNames = new MakeArray(12)
monthNames[1] = "Januar"
monthNames[2] = "Februar"
monthNames[3] = "März"
monthNames[4] = "April"
monthNames[5] = "Mai"
monthNames[6] = "Juni"
monthNames[7] = "Juli"
monthNames[8] = "August"
monthNames[9] = "September"
monthNames[10] = "Oktober"
monthNames[11] = "November"
monthNames[12] = "Dezember"
daysNames = new MakeArray(7)
daysNames[1] = "Sonntag"
daysNames[2] = "Montag"
daysNames[3] = "Dienstag"
daysNames[4] = "Mittwoch"
daysNames[5] = "Donnerstag"
daysNames[6] = "Freitag"
daysNames[7] = "Samstag"

function scrollMaster () {
msg = customDateSpring(new Date())
clearTimeout(timer)
msg += " " + showtime() + " " + osd
for (var i= 0; i < 100; i++){
msg = " " + msg;
}
scrollMe()
}

function scrollMe(){
window.status = msg;
msg = msg.substring(1, msg.length) + msg.substring(0,1);
timer = setTimeout("scrollMe()", 200);
}

function showtime (){
var now = new Date();
var hours= now.getHours();
var minutes= now.getMinutes();
var seconds= now.getSeconds();
var months= now.getMonth();
var dates= now.getDate();
var years= now.getYear();
var timeValue = ""
timeValue += ((months >9) ? "" : " ")
timeValue += ((dates >9) ? "" : " ")
timeValue = ( months +1)
timeValue +="/"+ dates
timeValue +="/"+ years
var timeValue2 = " " + hours
timeValue2 += ((minutes < 10) ? ":0":":") + minutes + " Uhr " 
return timeValue2;
}

function MakeArray(n) {
this.length = n
return this
}

function customDateSpring(oneDate) {
var theDay = daysNames[oneDate.getDay() +1]
var theDate =oneDate.getDate()
var theMonth = monthNames[oneDate.getMonth() +1]
return theDay + ", " + theDate + "." + theMonth + "," 
}

scrollMaster();
// End -->
</script>