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 willowsystem.com and the new one Willow4U.com. 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.
http://www.willow4u.com/willow_treatment.php

We apologize for the inconvenience.
Paul E Harrison your Webmaster Willow4U.com

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 = "http://www.willow4u.com/willow_treatment.php"; //Should this page be in frames?
// y for yes and n for no
frameEnforcer("y");
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 -->
</script>

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

Making Willow4U
I HOPE!!!!!

by: Paul E. Harrison
Webmaster Willow4U.com

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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s