Chapter 3: Using Java on Your Pages |
index | previous | next | |||||
|
||||||
|
Displaying a message for non-Java browsersWhile most browsers these days have Java, some people use old browsers, and some surf the Web with Java turned off. In these cases, you should display a message letting people know what cool thing they're missing, as demonstrated in Listing 3.2.
To display a message for browsers without Java:1. <H1>If you had Java, you'd be seeing a cool applet now</H1> You might think that this looks just like normal HTML, and you'd be correct - it is. However, because it's within the APPLET tag, it's only shown when the user can't display the Java applet. Figure 3.2 shows how this displays on the screen.
TipsIn Figure 3.2, you might notice that the no Java message isn't in the same area that's set aside for the Java applet. Because the browser doesn't understand Java, it doesn't know about the HEIGHT and WIDTH attributes in the APPLET tag. Be sure to keep this in mind when laying out your pages. Any HTML tags can go into this area. Be creative, but also be careful about closing any tags you open.
|