Jump to content
MakeWebGames

jquery countdown wont work


Ben-Nasha

Recommended Posts

Iv got this jquery countdown it should say Redirecting 10,9 and go on and then redirect but it wont i dont know whats wrong with it....

 

 

<html>
<head>
<title> Redirecting... </title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var number = 10;
var url = 'http://www.google.co.uk';
function redirect(number,url) {
number = number;
url = url;
countdown();
}

function countdown () {
setTimeout(countdown,1000);
$('#redricting').html("Redirecting in " + number + " seconds");
number --;
if (number<0) {
window.location = url;
number = 0;
}
}

</script>
</head>
<body>

<div id="redirecting"> Redirecting box </div>
</body>
</html>
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...