<div id="message"></div> <script language="JavaScript"> setTimeout("noframe()", 1000); </script>

Ray's Test Page - Testing for browsers that don't support frames.

Using a timer

If the browser doesn't support frames then the following message will appear "Your browser does not support frames. Redirecting you to a non-frame page in X seconds" Where, in the code, the time is set to three seconds.

To do this, put the following code in the HEAD section of the webpage ...

<script language="JavaScript">
var count=0;
var timex=3;
function noframe(){
count++;
message.innerHTML="Your browser does not support frames. Redirecting you to a non-frame page in " + timex + " seconds";
timex=3-count;
if (timex==0){
open("http://brisray.com/index.html","_top");
}
setTimeout("noframe()", 1000);
}
</script>

Obviously, you can change the timing by changing the time from 3 to whatever you want - in both places it appears. Also, change the URL to whatever it is you want it to be.

In the BODY section of the page, put this ...

<noframes>
<div id="message"></div>
<script language="JavaScript">
setTimeout("noframe()", 1000);
</script>
</noframes>

Using an immediate page change

A very much simpler code, but more confusing for your visitors, is to just change the page. You can do this easily. In the HEAD section of your code put ...

<script language="JavaScript">
function noframe(){
open("http://brisray.com/index.html","_top");
}
</script>

In the BODY section put ...

<noframes>
<script language="JavaScript">
noframe()
</script>
</noframes>

Using an action by the user

You may want your visitors to take some action before they are redirected. In the following example, a button is created for them to click on. In the HEAD section put ...

<script language="JavaScript">
function noframe(){
open("http://brisray.com/index.html","_top");
}
</script>

In the BODY section put ...

<noframes>
<p>Your browser does not support frames</p>
<form method="POST">
<p><input type="button" value="Click here for non framed pages" name="B1" onclick="noframes()"></p>
</form>
</noframes>

<p>Your browser does not support frames</p> <form method="POST"> <p><input type="button" value="Click here for non framed pages" name="B1" onclick="noframes()"></p> </form>

 

Whichever method you use, you can test the code is working by placing <!-- and --> around the <noframes> and </noframes> tags.

This page created 20th March 2004


GoStats stats counter