Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

timed auto redirect

  • 09-06-2008 09: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,144 ✭✭✭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, Registered Users 2 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