Skip to content

Instantly share code, notes, and snippets.

@sikandar0308
Forked from Joel-James/countdown-redirect.html
Last active December 30, 2019 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sikandar0308/4b7b71c34472c72b41bc5099ef5b5b91 to your computer and use it in GitHub Desktop.
Save sikandar0308/4b7b71c34472c72b41bc5099ef5b5b91 to your computer and use it in GitHub Desktop.
<!-- Modify this according to your requirement -->
<h3>
Redirecting to Jobsmartpakistan.com after <span id="countdown">10</span> seconds
</h3>
<!-- JavaScript part -->
<script type="text/javascript">
// Total seconds to wait
var seconds = 10;
function countdown() {
seconds = seconds - 1;
if (seconds < 0) {
// Chnage your redirection link here
window.location = "https://Jobsmartpakistan.com";
} else {
// Update remaining seconds
document.getElementById("countdown").innerHTML = seconds;
// Count down using javascript
window.setTimeout("countdown()", 1000);
}
}
// Run countdown function
countdown();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment