Forum Moderators: open

Message Too Old, No Replies

Using the <object> tag to embed java applets.

I need validated XHTML 1.1

         

Ouroboros

5:39 pm on Jun 10, 2004 (gmt 0)

10+ Year Member



I have been absolutely pulling my hair out trying to get a java applet to both validate and run under XHTML 1.1. The java applet is a panorama applet which I can get to work and validate in Mozilla, but does not work in Internet Explorer unless I use code that will not validate. The code which I think is right is the following, but it fails in IE (it does validate XHTML 1.1):

<object codebase="java" classid="panorama.class" height="196" width="460" >
<param name="panorama" value="path-to-photo.jpg" />
<!--[if!IE]> Mozilla/Netscape and its brethren -->
<object codebase="java" classid="java:panorama.class" height="196" width="460" >
<param name="panorama" value="path-to-photo.jpg" />
</object>
<!-- <![endif]-->
</object>

(Obviously, the codebase, "java", is a directory within which panorama.class resides, and the "java" directory is inside the same directory as the web page.)

Here is some information about the panorama java applet [www3.mistral.co.uk].

If any of you are able to make this work, I'd appreciate a comment.

BlobFisk

1:57 pm on Jun 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey Ouroboros,

In the classid within the IE conditionals should the java: be there? It looks a little out of place to me!

HTH

Ouroboros

8:07 pm on Jun 14, 2004 (gmt 0)

10+ Year Member



What you've referenced is the non-IE portion of the applet, and it seems a bit odd to me for it to be there as well (and I've not been able to find anything on the net which says why it is supposed to be there).

However, I have tested that fairly in Mozilla, and that portion of the tag both validates XHTML 1.1 and works, whereas if the "java:" portion of the classid is removed, it'll no longer work (which suggests that it is the right way to code that line for non-IE browsers).

The portion that is giving me problems is the portion for IE. I can write the portion for IE such that it will work (by replacing "classid" with "code"), but it won't validate. Written the way it validates, it won't work.

*sniff* *sniff* HELP! *sniff* *sniff*

Thanks for your response, btw.

Ouroboros

6:45 pm on Jun 19, 2004 (gmt 0)

10+ Year Member



Well, I suppose that there's good news in this: When you ask questions that no one can answer, it says something about one's status. I guess.

tedster

8:29 pm on Jun 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you check out this page?

[ww2.cs.fsu.edu...]

Ouroboros

10:08 pm on Jun 19, 2004 (gmt 0)

10+ Year Member



Thank you very much. The answer is that, yes, I have tried that and while it validated, it didn't work.

That is, until now.

I couldn't remember precisely what the results were when I used that method (a direct copy/paste of the non-archive [.jar file] related code), so I just tried it again in order to give a more complete answer about why it doesn't work.

But it did.

Thank you very much, tedster. I don't know what could have been the problem before (a caching issue seems the most plausible, though I've not implemented it precisely as before [no "codebase" attribute, as I just tried it in its simplest form with the .html file in the same directory as the java]), but without your dialogue I would never have gone back to try that again.

Now if I only knew of an exhaustive explanation of "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93".

Thanks again.

Ouroboros

10:29 pm on Jun 19, 2004 (gmt 0)

10+ Year Member



Ah, bummer. The "codebase" issue has turned out to be precisely it - I can't get it to work. The java crashes every time.

So, if you've got 8,252 directories, each which you intend to use with java, you have to have separate copies of the java in those 8,252 directories.

That just can't be right. So why doesn't it work?

Update: Well, that didn't take long. Even though there is a "codebase" attribute associated with the "object" tag, it apparently doesn't do the same thing as the "codebase" attribute of the "applet" tag. Instead the codebase equivalent of the applet's tag is a "param" tag embedded between the "object" tags:

<param name="codebase" value="java" />

Solved, then. It's amazing that the documentation for this sort of thing is so difficult to find (non-existent?).