Applets and object in XHTML

R

Red Winestain

I've been asked to update some web pages to XHTML 1.0 strict so that it
validates via the w3c validator. This means I need to replace the
<applet> tags with <object>. How do you use an object tag to load a
java applet that lives elsewhere on the server?

For example, I used to use the following (for a class, not a jar):

<applet codebase="../classes/" code=AppletCode width=500 height=190>
<param name="variable" value="1">
Your browser does not have Java enabled.
</applet>

I've got the following to work (validate and load the applet) but only
if the html page is in the same directory as the applet:

<object
type="application/x-java-applet"
classid="java:AppletCode.class"
height="500" width="190" >
<param name="varialbe" value="1" />
Your browser does not have Java enabled.
</object>

I can't get any form of the codebase statement to work. Any suggestions?
 
R

Red Winestain

Adding the following seems to work (Safari, Opera, Camino, and
Firefox), in terms of validating and in loading the applet:

<param name="java_codebase" value="../classes/" />
 
R

Raymond DeCampo

Red said:
I've been asked to update some web pages to XHTML 1.0 strict so that it
validates via the w3c validator. This means I need to replace the
<applet> tags with <object>. How do you use an object tag to load a
java applet that lives elsewhere on the server?

For example, I used to use the following (for a class, not a jar):

<applet codebase="../classes/" code=AppletCode width=500 height=190>
<param name="variable" value="1">
Your browser does not have Java enabled.
</applet>

I've got the following to work (validate and load the applet) but only
if the html page is in the same directory as the applet:

<object
type="application/x-java-applet"
classid="java:AppletCode.class"
height="500" width="190" >
<param name="varialbe" value="1" />
Your browser does not have Java enabled.
</object>

I can't get any form of the codebase statement to work. Any suggestions?

I think that the classid attribute you have is off. The classid is not
a Java-specific attribute, it is used to identify the plug-in, in this
case the Java plug-in.

Try using the HTMLConverter tool that comes with the JDK (in the bin
directory with the other tools). This will at least get you started if
you do not like the results (as some here do not).

HTH,
Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top