php - how website running after countdown timeout with codeigniter -


i made countdown timer, how connect website after time runs out? i'm using codeigniter framework

this script countdown timer

<script> var target_date = new date('sep, 18, 2015 15:02:00 gmt-0700').gettime();  var days, hours, minutes, seconds;  var countdown = document.getelementbyid('countdown');  setinterval(function () {      var current_date = new date().gettime();     var seconds_left = (target_date - current_date) / 1000;      days = parseint(seconds_left / 86400);     seconds_left = seconds_left % 86400;      hours = parseint(seconds_left / 3600);     seconds_left = seconds_left % 3600;      minutes = parseint(seconds_left / 60);     seconds = parseint(seconds_left % 60);      countdown.innerhtml = '<div id="days" class="timer_box"><h1>' + days +  '</h1> <p>days</p></div> <div id="days" class="timer_box"><h1>' + hours + '</h1> <p>hours</p></div> <div id="days" class="timer_box"><h1>'     + minutes + '</h1> <p>minutes</p></div> <div id="days" class="timer_box"><h1>' + seconds + '</h1> <p>seconds</p></div>';    }, 1000); </script> 

if understand question correctly, looking redirect website want user visit.

there plenty of tutorials on how it, example

https://stackoverflow.com/a/506004/1080604

the solution is, check if time remaining smaller 1 interval-time, , call window.location.replace.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -