C
Christopher J. Henrich
I am trying to prepare web pages that contain applets. The old way,
which uses the <applet> tag, has been deprecated for a long time, and
is rejected if the web page is declared to be strict HTML. The new,
correct, way that is supposed to be portable across browsers is to use
an <object> tag.
The exact details of how to use an object tag are not completely
spelled out, anywhere that I have found. Mostly, one finds examples of
"this works for me." Well, here is a sample that does work for me, on
several Mac browsers.
<object
classid="java:XXXXX.class"
codetype="application/octet-stream"
data="java"XXXXX.class"
type="application/x-java-applet"
archive="YYYYY.jar"
width = "500"
height = "300" >
</object>
Here, "XXXXX" should be the name of the principal class in the applet
(probably an extension of Applet or JApplet), and "YYYYY.jar" should be
a path to the archive file; I make this path be relative to the
location of the HTML file, but I think it could be a general URL .
I have tested this successfully with Safari, Camino, Mozilla, Netscape,
and Firefox. My test fails o iCab; I think there are serious problems
with CSS and layout that may have interfered.
I welcome criticism, and information on whether this markup is OK for
Windows browsers.
which uses the <applet> tag, has been deprecated for a long time, and
is rejected if the web page is declared to be strict HTML. The new,
correct, way that is supposed to be portable across browsers is to use
an <object> tag.
The exact details of how to use an object tag are not completely
spelled out, anywhere that I have found. Mostly, one finds examples of
"this works for me." Well, here is a sample that does work for me, on
several Mac browsers.
<object
classid="java:XXXXX.class"
codetype="application/octet-stream"
data="java"XXXXX.class"
type="application/x-java-applet"
archive="YYYYY.jar"
width = "500"
height = "300" >
</object>
Here, "XXXXX" should be the name of the principal class in the applet
(probably an extension of Applet or JApplet), and "YYYYY.jar" should be
a path to the archive file; I make this path be relative to the
location of the HTML file, but I think it could be a general URL .
I have tested this successfully with Safari, Camino, Mozilla, Netscape,
and Firefox. My test fails o iCab; I think there are serious problems
with CSS and layout that may have interfered.
I welcome criticism, and information on whether this markup is OK for
Windows browsers.