AlfIron: Javascript Countdown Browsercompatibel

Beitrag lesen

  
<!--  
var now = new Date();  
var year = now.getYear();  
if (year < 1900) {  
	year += 1900;  
}  
var end = new Date("Febuary 3, " + "2011" + " 23:00:00 GMT");  
  
  
  
function toSt2(n) {  
  s = "";  
  if (n < 10) s += "0";  
  return (s + n).toString();  
}  
function toSt3(n) {  
  s = "";  
  if (n < 10) s += "00";  
  else if (n < 100) s += "0";  
  return (s + n).toString();  
}  
function countdown() {  
  d = new Date();  
  count = Math.floor(end.getTime() - d.getTime());  
  if(count > 0) {  
    miliseconds = toSt3(count%1000); count = Math.floor(count/1000);  
    seconds = toSt2(count%60); count = Math.floor(count/60);  
    minutes = toSt2(count%60); count = Math.floor(count/60);  
    hours = toSt2(count%24); count = Math.floor(count/24);  
    days = count;  
    document.getElementById('c1').innerHTML = days;  
	document.getElementById('c2').innerHTML = hours;  
	document.getElementById('c3').innerHTML = minutes;  
	document.getElementById('c4').innerHTML = seconds;  
    setTimeout("countdown()", 50);  
  }  
}  
window.onload=countdown;  
//-->  

  
<div id="countd">  
<img src="feierstadt.jpg" alt="Feierstadt Hamburg"/><br /><br /><p>Feierstadt.de - Feiern in Hamburg.<br> Der Countdown bis zum Start:</p><p>&nbsp;</p><p>&nbsp;</p>  
<div class="wrap">TAGE<div id="c1" class="x"></div></div>  
<div class="wrap">STUNDEN<div id="c2" class="x"></div></div>  
<div class="wrap">MINUTEN<div id="c3" class="x"></div></div>  
<div class="wrap">SEKUNDEN<div id="c4" class="x"></div></div>  
</div>  

Der Code Funktioniert leider nur im Google Chrome. Verstehe nicht warum er im Firefox die Zahlen weglässt. Hat Jemand einen Vorschlag?

Danke AlfIron