Re: java detection test on a webpage with applet




"Rhino" <no.offline.contact.please@xxxxxxxxxx> wrote in message news:OqN8g.16173$M31.165695@xxxxxxxxxxxxxxxxxxxxxxxx

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

.



Relevant Pages

  • Re: java detection test on a webpage with applet
    ... the applet cannot be displayed in this browser. ... My understanding of HTML ... is that if the browser doesn't recognize a tag, it simply ignores it, so ...
    (comp.lang.java.help)
  • Re: Anyone experienced in express data with figures?
    ... > applet and swing are not necessarily separate things. ... > simple HTML, or the JTable class. ... not every browser has Java installed. ...
    (comp.lang.java.programmer)
  • Re: OT: HTML (WAS: MF having issues?)
    ... But let's say I don't actually read the standards, but just try out the tag to see what it does, and I notice that on my particular browser, the tag displays the text in italics. ... So now my HTML page may be broken, for example, if it contained text like this: ... The idea is that browsers who do not recognize the <applet> tag will simply ignore that tag, and display the text without any special formatting. ...
    (comp.lang.cobol)
  • Re: file access in jythonc
    ... Just the html code gives message. ... "applet", and thus allowed to execute only in the "applet sandbox" ... inside that browser. ...
    (comp.lang.python)
  • Re: APPLET tag isnt runing
    ... You need to install Java. ... | understands the APPLET tag but isn't running the applet, ... | Your browser is ignoring the TAG. ...
    (microsoft.public.windowsxp.games)