I'm very confused, with greasemonkey setTimeout just isn't working, it never calls the function, looking online people say greasemonkey doesn't support setTimeout, is there anyway to make my objective (below) work?
function countdown(time, id) {
if(document.getElementById(id)) {
var name = document.getElementById(id);
var hrs = Math.floor(time / 3600);
var minutes = Math.floor((time - (hrs * 3600)) / 60);
var seconds = Math.floor(time - (hrs * 3600) - minutes * 60);
if(hrs>0) {
name.innerhtml = hrs + 'h ' + minutes + 'm';
} else if(minutes>0) {
name.innerhtml = minutes + 'm ' + seconds + 's';
} else {
name.innerhtml = seconds + 's';
}
} else {
setTimeout('countdown(' + --time + ',' + id + ')', 100);
}
if(time <= 0)
window.location.reload();
else
setTimeout('countdown(' + --time + ',' + id + ')', 1000);
}