Timed Blogger Redirect Script

tygrus

Supreme Member
Joined
Mar 28, 2009
Messages
1,234
Reaction score
699
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
 
Please PM me if you have a solution. Much appreciated.
 
<script type="text/JavaScript">
<!--
redirectTime = "1500";
redirectURL = "YOUR-URL";
function timedRedirect() {
setTimeout("location.href = redirectURL;",redirectTime);
}
// -->
</script>


Time is in milliseconds
 
Thanks unravelled. Your help is much appreciated. Thanks given.
 
Sorry for the newbish question....

Where should i paste this code in blogger?

Pls Reply.
 
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.
 
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...
 
Last edited:
thanks guys. I will try and figure this out. Once I do, thanks or reps will be given..
 
u can just add a widget, and use 'add a html/javascript' option
 
Back
Top