Dethman Posted April 25, 2009 Share Posted April 25, 2009 Hi guys Im still learning JS and I found this countdown then redirect script I tried to edit it to count down then display an html link can you take a look at it and tell me whats wrong? <form name="redirect"> <center> <font face="Arial"><b>You will be redirected to the script in<br><br> <form> <div name="redirect2"></div> </form> seconds</b></font> </center> <script> <!-- /* Count down then redirect script By JavaScript Kit (http://javascriptkit.com) Over 400+ free scripts here! */ //change below target URL to your own var targetURL="" //change the second to start counting down from var countdownfrom=<?=$seconds;?> var currentsecond=document.redirect.redirect2.value=countdownfrom+1 function countredirect(){ if (currentsecond!=1){ currentsecond-=1 document.redirect.redirect2.value=currentsecond } else{ var countdownfrom="<a href='buildings.php'>Count Down Successfull</a>" return } setTimeout("countredirect()",1000) } countredirect() //--> </script> Thanks Alot Brian Flores CEO Nimbusgames,llc Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 26, 2009 Share Posted April 26, 2009 Fixed missing </form> tag and put in missing semi colons: <form name="redirect"> <center> <font face="Arial"><b>You will be redirected to the script in<br><br> <form> <div name="redirect2"></div> </form> seconds</b></font> </center> <script type = "text/javascript" language = "Javascript"> <!-- /* Count down then redirect script By JavaScript Kit (http://javascriptkit.com) Over 400+ free scripts here! */ //change below target URL to your own var targetURL=""; //change the second to start counting down from var countdownfrom=<?= echo $seconds;?>; var currentsecond=document.redirect.redirect2.value=countdownfrom+1 function countredirect(){ if (currentsecond!=1){ currentsecond-=1 document.redirect.redirect2.value=currentsecond } else{ var countdownfrom="<a href='buildings.php'>Count Down Successfull</a>" return } setTimeout("countredirect()",1000) } countredirect() //--> </script> </form> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.