timer also offline
<p>I got this as a timer that counts down from  55 minutes to 0. It works fine but when i disconnect the internet the counter will not run anymore. I think it is in the "countdownInterval() command but i don't know for sure. I also don't know how to fix it... </p>

<p>My counter:</p>

<pre><code>&lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"&gt;&lt;/script&gt;

&lt;script&gt;
$(document).ready(function() {
    countdownInterval(
    // TO DO:  Zie dat je dit aanpast naar je wensen  !!!!!!!!!!!
    &lt; ? php // UUR.
    echo($th); ? &gt; , &lt; ? php // MINUTEN
    echo($tm); ? &gt; , &lt; ? php // SECONDEN
    echo($ts); ? &gt; );
});

// globals
var dateObj = null;
var targetDateObj = null;
var timerObj = null;

function doCountdown() {
    timerObj.setHours(targetDateObj.getHours() - dateObj.getHours());
    timerObj.setMinutes(targetDateObj.getMinutes() - dateObj.getMinutes());
    timerObj.setSeconds(targetDateObj.getSeconds() - dateObj.getSeconds());
    displayFunction();
    if (
    timerObj.getHours() == 00 &amp;&amp; timerObj.getMinutes() == 00 &amp;&amp; timerObj.getSeconds() == 00) {
        alertFunction();
        return null;
    }
    dateObj.setSeconds(dateObj.getSeconds() + 1);
    setTimeout("doCountdown()", 1000);
}

function countdownInterval(H, i, s) {
    dateObj = new Date();
    timerObj = new Date();
    targetDateObj = new Date();
    targetDateObj.setHours(dateObj.getHours() + H);
    targetDateObj.setMinutes(dateObj.getMinutes() + i);
    targetDateObj.setSeconds(dateObj.getSeconds() + s);
    doCountdown();
}

function checkTime(i) {
    if (i &lt; 10) {
        i = "0" + i;
    }
    return i;
}

function displayFunction() {
    $('#count2').val(
    checkTime(timerObj.getHours()) + ":" + checkTime(timerObj.getMinutes()) + ":" + checkTime(timerObj.getSeconds()));
}

function alertFunction() {
    // HIER KOMT DUS DE POPUP
    window.location.replace('einde.php');;
}
&lt;/script&gt;
</code></pre>
