Jump to content
xisto Community
FirefoxRocks

Help With Java Applet With XHTML 1.1/XHTML 1.0 Strict

Recommended Posts

I have a Java Applet for a chat room that is using the <applet> tag. It looks like it was from HTML 3.2 but I am using XHTML 1.1 (application/xhtml+xml), so I have to use the <object> element.For now I have forced that page to load as XHTML 1.0 Transitional in text/html MIME type because I don't know how to fix the problem. I have tried many suggestions from many sites but they don't work in Firefox, Internet Explorer or Opera (some of them are IE-only but they still don't work in IE).Is there any way that the <object> element can be implemented with cross-browser compatibility? I thought it would be as easy as <object> for Flash, but I guess not.

Share this post


Link to post
Share on other sites

I have a Java Applet for a chat room that is using the <applet> tag. It looks like it was from HTML 3.2 but I am using XHTML 1.1 (application/xhtml+xml), so I have to use the <object> element.

 

For now I have forced that page to load as XHTML 1.0 Transitional in text/html MIME type because I don't know how to fix the problem. I have tried many suggestions from many sites but they don't work in Firefox, Internet Explorer or Opera (some of them are IE-only but they still don't work in IE).

 

Is there any way that the <object> element can be implemented with cross-browser compatibility? I thought it would be as easy as <object> for Flash, but I guess not.

Well, take a look to the help section of the W3C Validator website, it has a lot of usefull tips, check How can I include flash in valid (X)HTML Web pages? and the Flash Satay technique, both of them are related to flash but i think that could help you.

 

Best regards,

Share this post


Link to post
Share on other sites

Well, take a look to the help section of the W3C Validator website, it has a lot of usefull tips, check How can I include flash in valid (X)HTML Web pages? and the Flash Satay technique, both of them are related to flash but i think that could help you.

 

Best regards,

I already use that method to incorporate Flash into my pages. I need help implementing a Java applet, not a Flash object. It doesn't work that way, I already tried it.

Share this post


Link to post
Share on other sites

I already use that method to incorporate Flash into my pages. I need help implementing a Java applet, not a Flash object. It doesn't work that way, I already tried it.

Sorry, take a look at the XHTML Reference - Object website for a complete reference.
Best regards,

Share this post


Link to post
Share on other sites

I know the attributes for <object>. I just don't know what to put in which attribute where.Here is the original code that the site gives you:

<table border=0 width=500 align=center><tr><td><applet archive="http://http://www.freejavachat.com/java/cr.zip; codebase="http://http://www.freejavachat.com/java/; 	name=cr code="ConferenceRoom.class" width=500 height=300> (some alternate text)</applet></td></tr></table><br><center><a href="http://http://www.freejavachat.com/ Chat</a> provided by freejavachat.com</center>

The main thing in there is the <applet>. I tried using:

<object archive="http://http://www.freejavachat.com/java/cr.zip; data="http://http://www.freejavachat.com/java/; name='cr' codebase="ConferenceRoom.class" style="width:500px;height:300px"> (some alternate text)</object>

But it doesn't seem to work.I have tried some other combinations of the <object> attributes but I haven't been able to get it right.

Share this post


Link to post
Share on other sites

Well, look at the params. Codebase for example, you gave it a totally different input. What happens when you use the <applet ... > from the first, then change applet to object?

Share this post


Link to post
Share on other sites

Well, look at the params. Codebase for example, you gave it a totally different input. What happens when you use the <applet ... > from the first, then change applet to object?

I changed codebase because the codebase referred to in <applet> is actually the data of the object. And if I just change the element name from <applet...> to <object...> then it will still not function properly.

Share this post


Link to post
Share on other sites

Ok, here's what I got from one website:

XHTML (using object tag)	  <!--[if !IE]>-->	  <object classid="java:Sample2.class" 			  type="application/x-java-applet"			  height="300" width="450" >	  <!--<![endif]-->		<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" 				 height="300" width="450" > 		  <param name="code" value="Sample2" />		</object> 	  <!--[if !IE]>-->	  </object>	  <!--<![endif]-->

You could use some sort of JavaScript to display the correct one.

The site is http://www.cs.fsu.edu/ if that's not exactly what you're looking for (they have more).
Edited by bluefish (see edit history)

Share this post


Link to post
Share on other sites

It looks like the above method is the best bet. I'm very disappointed in the lack of full support of objects in browsers. For example, there are some tricks that use inline frames which should be able to use objects, but unfortunately, changing parameters via javascript doesn't cause the object to be reloaded, and I have yet to find a way to reload objects manually. But I think merging the above method with the Flash-Satay method should yield good results, especially since streaming Java applets is usually not possible anyway.~Viz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.