Javascript Countdown Returning NaN on Safari (iPhone)

Viewed 32

I need help with this too! I have a function:

timer = Math.round(timer); //here I recipe X seconds (timer)
var downloadTimer = setInterval(function(){
    if(timer <= 0){
        document.location.reload(true);
    } else {
        minutes = parseInt(timer / 60, 10);
        seconds = parseInt(timer % 60, 10);
        minutes = minutes < 10 ? "0" + minutes : minutes;
        seconds = seconds < 10 ? "0" + seconds : seconds;
        document.getElementById('counterShow').textContent = minutes + ":" + seconds; //here I show the time for finish
    }
    timer -= 1;
}, 1000);

On Chrome is working perfect, but in Safara iOS (Chrome iOS too) not working.

0 Answers
Related