Redirect based on screen size
<script language="javascript">
var large = "large.html";
var standard ="standard.html";
var mobi ="mobi.html";
        if (screen.height <= 400)
{window.location.href = mobi }
else if (screen.height <= 768)
{window.location.href = standard }
else
{window.location.href = large }
//->
</script>
There are so many different monitor sizes available that it is tough to design a website that looks great on all of them, with this script you can redirect someone to the page that best suits their screen height.

Paste this script between your head tags.
<meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
If you update your page regularly and some visitors still
see the old version, this can come in handy.

Place between the head tags to force refresh of pages on every visit.
Force refresh of page
If you use frames on your page and someone links to a frame page the parent frame will not be shown, and with it your menu. Paste this script between the head tags to reditect to your home page
<SCRIPT LANGUAGE='javascript'>if (top == self) {top.location.href='index.html'; } </SCRIPT>
Redirect iframe to the homepage
<script language="javascript" type="text/javascript">
if(self==top)
{top.location.href="index.html?url="+self.location.href;}
</script>
The script above will only redirect to the index page, if you want to load the correct frame do the following.

On all your frame pages paste the top script between the head tags.

On your INDEX page paste the second script just before the end body tag
Replace ****** with the name of your iframe
Redirect iframe to the homepage
<script language="javascript" type="text/javascript">
if (top.location.search.substr(0,5)=="?url=") {
self.frames["******"].location.href = top.location.search.substr(5);}
</script>
My very own Java script collection
If you are looking for a java script to create snowflakes on your website or have pretty little stars follow your mouse pointer around (annoying your visitors), you came to the wrong place.

Java scripts are meant to improve your website not destroy it, unless you are designing for a bunch of toddlers then by all means please go ahead.
.
Home - Web Design - Website Tools - Website Tips - Web Hosting - On the Web - Wallpaper - About - Contact
admin@mhx.co.za