[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: JAVASCRIPT



Hallo Alexander,
ist natürlich O.T. aber trotzdem mal eine mögliche Antwort, da das ein schöner Beweis ist,
wie Mickysoft ein Javascript zerschiesst. Ich nehme mal an, Du hast Frontpage 3.0 benutzt und da fängt der Ärger an (stand
zumindest im Metatag). Ein Script in einem Layer ist mir völlig neu. Die script-Tags am Ende völlig unklar.
Gross-Kleinschreibung beachten! Alle weitere Fragen dann direkt an mich.
... und der Havana Club ist sowieso der beste Rum (siehe meine HP).

<html>
<head>
<script>
function tick() {
var hours, minutes, seconds, day, month, today, year;
today = new Date(); hour=today.getHours();
minutes=today.getMinutes(); seconds=today.getSeconds();
year=today.getYear();

/* hier wird ein Netscape - Problem behoben, da getYear 100 liefert
funktioniert aber erst ab dem Jahr 2000 */

 if (document.layers){
    year = ""+year
    year = year.slice(1,3);
    year = "20"+year;
  }
//ende

day=today.getDate(); month=today.getMonth()+1;
      if (seconds < 10) {seconds="0"+seconds;}
      if (minutes < 10) {minutes="0"+minutes;}
      if (month < 10) {month="0"+month;}
timeString=day + "." + month + "."+year+" "+ hour+":"+minutes+":"+seconds;
//hier mache ich die Ausgabe fett oder sonst was
Ausgabe = "<b>"+timeString+"</b>";
// Abfrage ob das Dokument das all-Objekt unterstützt, dann IE oder evtl. kommende Netscape-Versionen
if (document.all){
  Clock.innerHTML = Ausgabe;
  }else{
   //netscape-teil
   document.Clock.document.write(Ausgabe);
   document.Clock.document.close();
  }
window.setTimeout("tick();", 100);
}
</script>
</head>
<body onLoad="tick()">
<br><br>
<!-- font definition raus und als html machen, netscape kommt mit nicht mit allem klar.
Wichtig ist aber die position:absolute -->
<div name="Clock" id="Clock" style="position:absolute; left:10; top:10; width:110; height:30">
</div>
<br><br>
folgender Befehl ist völlig unklar
window.onload = tick;
hättest Du hier onLoad korrekterweise mit großem L geschrieben hätte auch IE nix gemacht!!! So übergeht IE den Befehl und
ruft tick() auf.
</body></html>

Alexander Schmidt schrieb:

> Hey Leute,
>
> Ich habe ein script für eine Webseite geschrieben.
> Im IE wird diese korrekt ausgeführt nur mit Netscape gibt es immer ein Error.
> Da ja der IE unter Linux nicht läuft möchte ich natürlich auch das die Linuxuser die Seite korrekt angezeigt bekommen.
> Website http://www.consultants.de/cubacon
> Hat jemand von euch eine Idee ? Ich weiß echt nicht mehr weiter.
>
> <div id="Clock" align="center" style="font-family:
>  Verdana; font-size: 16; font-weight=bold;
>  color:#00FFFF">
> <p align="center"><script>
> function tick() {
>   var hours, minutes, seconds, day, month, today, year;
>   today = new Date(); hour=today.getHours();
>   minutes=today.getMinutes(); seconds=today.getSeconds();
>   year=today.getYear();
>   day=today.getDate(); month=today.getMonth()+1;
>    if (seconds < 10) {seconds="0"+seconds;}
>          if (minutes < 10) {minutes="0"+minutes;}
>          if (month < 10) {month="0"+month;}
>   timeString=day + "." + month + "."+year+" "
>    + hour+":"+minutes+":"+seconds;
>   Clock.innerHTML = timeString;
>   window.setTimeout("tick();", 100);}
>   window.onload = tick;
> </script>&nbsp;</p>
> </div><script>
> </script>
> A:Schmidt ngi de
> A Schmidt vebis de
> APSchmidt gmx de
>
> http://www.vebis.de

--
Dipl.-Kaufmann Roger Schmidt
roger schmidt t-online de
http://www.netzschmerle.de

As proved by various scientific experiments
the bumble-bee is unable to fly.
However, ignoring these scientific phenomena,
the bumble-bee does fly.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]