Thursday, November 18, 2010

JS Timer

var icount = 10;
var t;
function ticker() {
countDown();
t = setTimeout("ticker()", 1000);
if (icount <= 0) {
clearTimeout(t);
window.location = "http://performance";
}
}

function countDown() {
icount--;
document.getElementById('idCounter').innerText = icount;
}

No comments: