...

View Full Version : Applet & object tag - xhtml1.1



Diane
02-26-2005, 03:15 PM
This is really driving me bananas - can anyone help/advise? I have more or less got my pages validating as xhtml1.1 except for where I have been using java applets. I know the applet tag is deprecated in xhtml1.1 and to use the object tag instead. Unfortunately, the object tag doesn't support the code tag and without a compatable alternative, the applet won't load. Does anyone know how to resolve this? The below code validates as xhtml1.1 - but doesn't work!


<object type="application/x-java-object"
classid="java:Grid.class" (changed from code="Grid.class")
name="CCXWORD"
width="401"
height="633"
archive="ccjava.zip"
id="CCXWORD">
<param name="DATAFILE" value="christmascrossword.ccj"/>
You need Java enabled to view the crossword applet.
</object>

I have searched the web for answers, but all I have found are similar questions from other people. It seems that in getting rid of applet in favour of object, W3C have thrown the baby out with the bath water!

Thank you in advance for any help!
Diane

whizard
02-27-2005, 03:07 AM
After some searching, I found this with Google. I don't know anything about Java embedding, but this was reported to be a fix for the problem.


<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" height="196" width="460" >
<param name="codebase" value="java" />;
<param name="code" value="panorama" />;
<param name="panorama" value="http://www.veiled-chameleon.com/images/hikes/grandeur-peak/grandeur-peak-full-circle.jpg" />;
<!--[if !IE]> -->;
<object codebase="java" classid="java:panorama.class" height="196" width="460" >;
<param name="panorama" value="http://www.veiled-chameleon.com/images/hikes/grandeur-peak/grandeur-peak-full-circle.jpg" />;
</object>

HTH, Dan

EDIT: forgot to give credit for code. here it is.

http://www.veiled-chameleon.com/weblog/archives/000004.html

Diane
02-27-2005, 01:10 PM
Hi Dan,
Thank you very much indeed for your help and the link. I can now get the applet to work and validate xhtml1.1 in IE, but I need to tinker with the code some more to get it to work in Netscape. At least I should be on the right track now - thank you again!
;0) Diane

whizard
02-27-2005, 02:37 PM
hey, no problem!

Dan

Daf
02-27-2005, 03:05 PM
Hi Diane,

The gecko browsers want to see the <embed></embed> tags - but they have be depreciated in xhtml... but there are some solutions I think... :\

See this article for a possible workaround:
http://ww2.cs.fsu.edu/~steele/XHTML/appletObject.html

This article deals with the xhtml1.1 standard but may still apply.

The Flash folks are having the same fit (Flash also needs object and embed for cross browser support) so you may want to do a search or both Java and Flash references - using keywords to that effect.

Good luck - and please post a solution if you find one - I would be interested I know. ;)

Daf

Diane
02-27-2005, 04:04 PM
:thumbsup: Thank you! I will look into it and I will certainly post a solution if I work it out! In the meantime, the code below works in Netscape, Mozilla, Opera and IE and validates xhtml1.1 for Flash buttons, if this is of help to anyone:

<object type="application/x-shockwave-flash"
data="button1.swf"
width="100"
height="22"
title="Example of a Flash button design">
<param name="movie" value="button1.swf"/>
<param name="quality" value="high"/>
<param name="base" value="."/>
<param name="bgcolor" value="#F8FFF8"/>
You need the Flash plug-in to view this object, which is merely a demo of a Flash navigation button.
</object>

;0) Diane

Diane
02-27-2005, 06:45 PM
Got it! The code below validates as xhtml1.1 and works in Internet Explorer 6, Netscape 7.02, Mozilla Firefox 1.0 and Opera 7.54.

<!-- MS IE (Microsoft Internet Explorer) will use outer object -->
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0"
height="633" width="401" >
<param name="code" value="Grid.class" />
<param name="DATAFILE" value="christmascrossword.ccj"/>
<param name="archive" value="ccjava.zip" />
<param name="name" value="CCXWORD" />
<!--[if !IE]> Mozilla/Netscape and others will use inner object -->
<object classid="java:Grid.class"
archive="ccjava.zip"
height="633" width="401" >
<param name="DATAFILE" value="christmascrossword.ccj"/>
<param name="name" value="CCXWORD" />
<strong>
This browser does not have a Java Plug-in.
<br />
<a href="http://java.sun.com/products/plugin/downloads/index.html">
Get the latest Java Plug-in here.
</a>
</strong>
</object>
<!-- <![endif]-->
</object>

Thank you both very much for your help - I could never have resolved this without you both!

Daf
02-27-2005, 07:09 PM
Thank you for posting the resolution! I've copied it into my notes for future reference. :)

Daf

Diane
02-27-2005, 10:52 PM
You're welcome!

whizard
02-28-2005, 03:30 AM
Maybe make this sticky?

Dan



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum