var time_s=3;
    function countSecond(url){
       time_s--;
      $("#tishi .sure-close").html(time_s+'s后自动跳转');
        if(time_s==0){
            window.location.href=url;
        }
      setTimeout("countSecond('"+url+"')", 1000);
    }


本文转载:CSDN博客