Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

timed auto redirect

Options
  • 09-06-2008 9:38am
    #1
    Closed Accounts Posts: 120 ✭✭


    hey

    fairly novice web developer here with a simple question

    I want to place an auto redirect on a splash page

    so for example user searches google, finds my site, they click and get a splash page, and then get redirected to website conent page after say five seconds

    I found this code and its probably just a case of adding the code for the time

    <head>
    ...head section stuff (Title, Description,etc.)...
    <meta http-equiv="refresh" content="5;url=pagename.html">
    </head>


    any help appreciated

    cheers


Comments

  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    Yep, just google html redirect and you'll get all the info you'll need! That code looks about right, but I wouldn't know it 100% off the top of my head.


  • Closed Accounts Posts: 7,145 ✭✭✭DonkeyStyle \o/


    It's all there, just change the 5 to how ever many seconds you want before redirect and pagename.html to what ever url.


  • Closed Accounts Posts: 120 ✭✭shantor


    client side if possible... something like this?

    <script>

    // Created by: Jon Brown :: http://allthingsrunescape.freewebs.com

    var c=5;
    var t;

    function timedCount() {
    document.title='Cagerage.tv | Redirecting in ' + c + ' seconds';
    c=c-1;
    t=setTimeout("timedCount()",1000);
    if (c==-1) {
    clearTimeout(t);
    document.title='Redirecting ...';

    self.location="http://www.cagerage.tv/index2.htm";
    }
    }

    window.onload=timedCount;
    </script>


  • Closed Accounts Posts: 120 ✭✭shantor


    It's all there, just change the 5 to how ever many seconds you want before redirect and pagename.html to what ever url.

    ah cool


  • Closed Accounts Posts: 120 ✭✭shantor


    all done
    cheers


  • Advertisement
  • Registered Users Posts: 3,594 ✭✭✭forbairt


    your original code would really be what you're after I think
    <meta http-equiv="refresh" content="5;url=http://www.mynewpage.com/page2.html" />
    

    By using the javascript .. you're relying on the browser having javascript enabled ... (while its rare enough that it isn't enabled .. it seems like a long way of going about it)


Advertisement