Timed Blogger Redirect Script

Discussion in 'Blogging' started by tygrus, May 28, 2009.

  1. tygrus

    tygrus Supreme Member

    Joined:
    Mar 28, 2009
    Messages:
    1,236
    Likes Received:
    827
    Occupation:
    Engineer
    Location:
    Canada
    I have been using a simple script to have my blogger blogs automatically redirect to another website.

    Here's my code:

    <script language="javascript">
    document.location='http://www.associatedcontent.com
    </script>

    Works well. However, I would like to add a time delay to it. Say redirect after 15 or 30 seconds.

    Does any one know how to add this enhancement.
    thx.

    tygrus
     
  2. pablorocker

    pablorocker Newbie

    Joined:
    Mar 13, 2009
    Messages:
    16
    Likes Received:
    3
    i know how :)
     
  3. tygrus

    tygrus Supreme Member

    Joined:
    Mar 28, 2009
    Messages:
    1,236
    Likes Received:
    827
    Occupation:
    Engineer
    Location:
    Canada
    Please PM me if you have a solution. Much appreciated.
     
  4. unravelled

    unravelled Junior Member

    Joined:
    Dec 4, 2008
    Messages:
    152
    Likes Received:
    79
    <script type="text/JavaScript">
    <!--
    redirectTime = "1500";
    redirectURL = "YOUR-URL";
    function timedRedirect() {
    setTimeout("location.href = redirectURL;",redirectTime);
    }
    // -->
    </script>


    Time is in milliseconds
     
    • Thanks Thanks x 2
  5. tygrus

    tygrus Supreme Member

    Joined:
    Mar 28, 2009
    Messages:
    1,236
    Likes Received:
    827
    Occupation:
    Engineer
    Location:
    Canada
    Thanks unravelled. Your help is much appreciated. Thanks given.
     
  6. thesmashge

    thesmashge Power Member

    Joined:
    Jan 14, 2009
    Messages:
    527
    Likes Received:
    524
    Sorry for the newbish question....

    Where should i paste this code in blogger?

    Pls Reply.
     
  7. unravelled

    unravelled Junior Member

    Joined:
    Dec 4, 2008
    Messages:
    152
    Likes Received:
    79
    Not sure about blogger, usually java works anywhere in the <head> and <body> of your page. Preferably <head> if possible. You can redirect using http refresh with an interval set in seconds if you can modify meta info.
     
  8. jhbalaji

    jhbalaji BANNED BANNED

    Joined:
    Nov 19, 2008
    Messages:
    58
    Likes Received:
    308
    Here is the complete template mate

    Code:
    <html>
    <head>
    <script LANGUAGE="JavaScript">
    <!--
    window.location.replace("http://WWW.YOURURL.COM/");
    -->
    </script>
    <noscript>
    <meta http-equiv="Refresh" content="10; URL=http://WWW.REDIRECT-URL.COM"/>
    <meta http-equiv="expires" content="10"/>
    <meta name="Description" content="301 moved permanently"/>
    <META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW"/>
    <META NAME="GOOGLEBOT" CONTENT="NOINDEX, FOLLOW"/>
    </noscript>
    <title>301 moved permanently</title>
    </head>
    <body>
    <center>
    <h1>YOUR TITLE</h1>
    <p>has been moved to new address</p>
    <a href=" http://WWW.YOURURL.COM"> <h1>http://WWW.YOURURL.COM</h1></a>
    <p>Sorry for inconvenience... </p>
    </center>
    </body>
    </html>

    A Rep or Thanks is appreciated...
     
    • Thanks Thanks x 2
    Last edited: May 29, 2009
  9. BHidiot

    BHidiot Registered Member

    Joined:
    Apr 3, 2009
    Messages:
    57
    Likes Received:
    4
    thanks guys. I will try and figure this out. Once I do, thanks or reps will be given..
     
  10. nikhil88

    nikhil88 Regular Member

    Joined:
    Jun 12, 2008
    Messages:
    208
    Likes Received:
    97
    Occupation:
    E&TC Engineering Student
    Location:
    Pune,India
    u can just add a widget, and use 'add a html/javascript' option