Re: java detection test on a webpage with applet
"Rhino" <no.offline.contact.please@nospam.com> wrote in message
news:OqN8g.16173$M31.165695@news20.bellglobal.com...
By following the advice in that link, I was able to get the following to
work:
<APPLET CODE = "com.foo.resume.ResumeApplet.class" CODEBASE = "." ARCHIVE
=
"jar/ResumeApplet.jar" WIDTH = "620" HEIGHT = "466" ALIGN = "baseline">
Sorry, the applet cannot be displayed in this browser.
</APPLET>
The "sorry" text was somewhat lost among the other text on the page since
it was the same font so I tried:
<APPLET CODE = "com.foo.resume.ResumeApplet.class" CODEBASE = "." ARCHIVE
=
"jar/ResumeApplet.jar" WIDTH = "620" HEIGHT = "466" ALIGN = "baseline">
<h1>Sorry, the applet cannot be displayed in this browser.</h1>
</APPLET>
That did NOT work; no paragraph appeared and there was no error message.
However, this DID work:
<APPLET CODE = "com.foo.resume.ResumeApplet.class" CODEBASE = "." ARCHIVE
=
"jar/ResumeApplet.jar" WIDTH = "620" HEIGHT = "466" ALIGN = "baseline">
<em>Sorry, the applet cannot be displayed in this browser.</em>
</APPLET>
The following approach also worked, which should please the original
poster because it includes a link. Naturally, he/she will probably want a
more appropriate message and a link that goes somewhere more relevant.
<APPLET CODE = "com.foo.resume.ResumeApplet.class" CODEBASE = "." ARCHIVE
= "jar/ResumeApplet.jar" WIDTH = "620" HEIGHT = "466" ALIGN = "baseline">
<a href="http://yahoo.com">Sorry, the applet cannot be displayed in this
browser.</a>
</APPLET>
I'm surprised that certain things don't work. My understanding of HTML
is that if the browser doesn't recognize a tag, it simply ignores it, so if
the browser doesn't know about the APPLET tag, it should simply treat the
document as if the tag was not there, and thus anything that's legal without
the APPLET tag should be legal with it.
Anyway, the W3C is the final authority on what is and isn't legal HTML.
I've used the validator available at http://validator.w3.org/ and the
following is legal according to HTML 4.1 Transitional:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>foo</title></head>
<body>
<APPLET CODE = "com.foo.resume.ResumeApplet.class" CODEBASE = "." ARCHIVE =
"jar/ResumeApplet.jar" WIDTH = "620" HEIGHT = "466" ALIGN = "top">
<h1>Sorry, the applet cannot be displayed in this browser.</h1>
</APPLET>
</body>
</html>
Of course, that doesn't help your users if they happen to be using a
webbrowser which doesn't comply to the standards. Depending on who wrote the
browser, you may be able to contact them and ask them to fix this bug in
their HTML parser.
- Oliver