JavaScript: Using a Frame Enforcer as a Redirect

JavaScript: Using a Frame Enforcer as a Redirect

Learning by doing and we’re off again!

Today I had to find a way of stopping the competition between our old site and the new one I also transferred the description of the Willow Treatment System form the old to the new, as I didn’t think the new one had the clout of the old one. You can take a look here and let me know what you think?

So back to the problem
There are so may redirect scripts out there, again I had no idea which to use. I wanted to make it automatic, but for the people that get there from Google & co. with scripts turned off (I’m not even convinced that people do that anymore, or know that they can?) the is a logo and a normal link, something like this:

improving lives since 1986

The page you requested has moved!
An automatic redirection is unfortunately not possible.
Please use the link below. Please update your bookmarks / favorites in your browser.

We apologize for the inconvenience.
Paul E Harrison your Webmaster

I added this in the head:

<meta name="robots" content="noindex,follow">

For the automatic bit I used this script:

<script language="JavaScript" type="text/javascript">
<!-- //Hide script from older browsers
//Set redirect page<br>
var url = ""; //Should this page be in frames?
// y for yes and n for no
function frameEnforcer(frames) {
if (frames == 'y'){
if (self.parent.frames.length == 0){
self.parent.location = url;
else if (frames == 'n'){
if (self.parent.frames.length != 0){                self.parent.location=url;
// end hiding contents -->

Now I know if there’s a better way you’ll tell me…

Making Willow4U
I HOPE!!!!!

by: Paul E. Harrison

Lets be friends on FacebookLets be friends on Google+Lets be friends on Twitter


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s