Created
April 21, 2015 16:21
-
-
Save ChristopherDosin/31c143bb07034e93f419 to your computer and use it in GitHub Desktop.
Javascript Countdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <b id="show-time">5</b> | |
<script type="text/javascript"> | |
var settimmer = 0; | |
$(function(){ | |
window.setInterval(function() { | |
var timeCounter = $("b[id=show-time]").html(); | |
var updateTime = eval(timeCounter)- eval(1); | |
$("b[id=show-time]").html(updateTime); | |
if(updateTime == 0){ | |
window.location = ("redirect.php"); | |
} | |
}, 1000); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment