| Java menu knowledge base Non-java browsers
How to cater for non-java browsers
It's not a good idea to put up buttons saying "click here for the java version" - in the first
place, this
is uncool; secondly, site visitors often click on the wrong buttons anyway; and finally, it tells everyone
you can't do auto-detection scripts.
Anyone can programme an easy little sequence of automatically loading pages that check
for java without the site visitor having to click anything.
This is a great
little trick which absolutely everyone who uses java should use on their websites.
Your main entry page contains a simple javascript automatically referring
the browser to a javascripted page using a conditional jump shown below.
If javascript is not available, the browser
stays with the first page. Or if javascript is available but java isn't, the
browser also stays with the first page.
If java and javascript are available, the second page
(page2.htm) loads automatically.
(The probability that java is available - but not javascript - is small).
Code for page1.htm:
<HTML>
<HEAD>
<SCRIPT>
if (navigator.javaEnabled()) top.location = "page2.htm"
</SCRIPT>
</HEAD>
<BODY>
<P>[Insert your non-java page code here]
</P>
</BODY>
</HTML>
Page2.htm is, of course, the page where you put your java.
The above code is the slickest way of doing it. But you should also
be aware that any HTML code between the applet tags will be displayed
in non-java browsers, but not in java browsers. So you could also
do it with just one page like this:
<APPLET.....>
[Insert applet parameters here]
<P>
[Insert text for non-java browsers here]
</P>
</APPLET>
|
|