I've tried various ways to make sure that my timer variable is global (and I believe it is) but why can't I clear the interval?
var timer;
function refreshtimer(timer) {
stoptimer(timer);
timer = window.setInterval(postmsg, time*1000);
}
function stoptimer(timer) {
window.clearInterval(timer);
timer = null;
}
I believe this is the relevant code section; however, the entirety of the code can be found here.