Winni
20. Juli 2002 um 20:36
1
Hallo Zusammen,
ich habe vor langer Zeit ein Script aus dem Internet gezogen, das mir bei einem best. Tag im Monat eine Meldung ausgibt.
In diesem Fall zeigt es an, wenn jemand Geburtstag hat. Ich muß jedoch jeden Monat die Geburtstage neu eintragen.
Wie muß ich das Scrpit ändern, daß ich die Geburtstage im ganzen Jahr eintragen kann ?
Danke für Eure Hilfe !!!
Gruß Winni
Hier das Script:
<!–
var today_obj=new Date()
var today_date=today_obj.getDate()
var tips=new Array()
var tiptitle=’<font face=„Arial“ color="#000080 "><small><B>Heute hat Geburtstag</B><br>’
tips[1]=’’
tips[2]=’’
tips[3]=‚Thorsten‘
tips[4]=’’
tips[5]=‚Timo‘
tips[6]=’’
tips[7]=’’
tips[8]=’’
tips[9]=’’
tips[10]=’’
tips[11]=’’
tips[12]=’’
tips[13]=’’
tips[14]=’’
tips[15]=’’
tips[16]=’’
tips[17]=‚Irfan‘
tips[18]=’’
tips[19]=’’
tips[20]=‚Manuel‘
tips[21]=‚Arno‘
tips[22]=’’
tips[23]=’’
tips[24]=’’
tips[25]=’’
tips[26]=’’
tips[27]=‚Rudi‘
tips[28]=’’
tips[29]=‚Harald‘
tips[30]=’’
tips[31]=’’
document.write(tiptitle)
document.write(tips[today_date]+’</small></font>’)
//–>
Hi Winni,
habs zwar nicht ausprobiert, aber auf die Schnelle sollte es so gehen:
var today_date=today_obj.getDate() + (100 * today_obj.getMonth());
Das Array ist dann wie folgt zu „befüllen“:
tips[1]…tips[31] für Monat Januar
tips[101]…[129] für Monat Februar
tips[201]…tips[231] für Monat März
tips[301]…tips[130] für Monat April
etc.
Mit getMonth wird der aktuelle Monat ermittelt und dann einfach mit 100 multipliziert und zum Tag dazuaddiert.
(P.S.: Januar = 0, Februar = 1 etc. !!)
CU (M)ike
Winni
20. Juli 2002 um 21:59
3
Hallo Mike,
erst mal danke für dieb schnelle Antwort.
Leider bin ich in Java-Script nicht so bewandert.
Wie und wo füge ich die Zeile
var today_date=today_obj.getDate() + (100 *
today_obj.getMonth());
in mein bestehendes Script ein ???
Muß ich bestehende Zeilen löschen ???
Danke nochmal
Gruß
Winni
[Bei dieser Antwort wurde das Vollzitat nachträglich automatisiert entfernt]
Hi Winni,
aus
var today_date=today_obj.getDate()
machst Du
var today_date=today_obj.getDate() + (100 * today_obj.getMonth());
Muß ich bestehende Zeilen löschen ???
nein, lediglich das Array (tips) erweitern.
Danke nochmal
Bitte
CU (M)ike