Here's the simple general idea (untested):

var count = 10;
var timer = null;

function countdown() {
     if (count >= 0) {
          count--;
          $("#time").text(count);  // update count
     }
     else {
          window.clearInterval(timer);  // stop the timer
          location.href = 'file.zip';
     }
}

// do countdown every second
timer = window.setInterval(countdown, 1000);


Your download will begin in <span id="time">10</span> seconds


On Mar 24, 2:21 pm, Joel Taylor <joelatay...@gmail.com> wrote:
> You know those sites that have the "Your download will begin in 10
> seconds" - and then it brings up a download window?
>
> How could you do that with jQuery - I've been trying several methods
> with the ajax functions and php headers ....
>
> Any ideas out there?
>
> Joel

Reply via email to