Applet or Object tag?

Started by jediTofu, July 17, 2011, 00:00:59

Previous topic - Next topic

jediTofu

I noticed that all of the LWJGL Applet tutorials use the applet tag, but isn't the applet tag now deprecated?  Does LWJGL suggest staying with the applet tag or now using the object tag?

I want to be as cross-browser compatible as possible.  Has anyone ever run into problems using the applet tag?
cool story, bro

kappa

Sun/W3 depreciated the <applet> tag in favour of the <object> tag. At the time IE implemented it but for whatever reason Mozilla implemented the <embed> tag instead. So for many years Mozilla browsers didn't support the object tag (might be supported now but not sure). However all browsers continued to support the <applet> tag for backward compatibility reasons. Thus the <applet> tag is the simplest way to use applets as it just works everywhere even though it was depreciated by Sun/W3.

The Oracle recommended way to deploy applets is to use the 'Java Deployment Toolkit' a javascript utility which will automatically chooses the best tag for you. Further it has the advantage of being able to detect java (in most cases) and point you to the java.com site if missing or if its out of date.

However since the JavaScript route adds a bit of complexity to deployment many avoid it.

jediTofu

Hmmm, yeah I don't want to use Javascript.  I guess the main applet will use the object tag.  Then I'll provide a link at the bottom "Click here if nothing shows", and that page will use the applet tag.

Is this a good approach?  I've also seen people use an iframe with src pointing to the applet before, but not sure how that is done.
cool story, bro

Mickelukas

I'd say go with the applet tag, it works in all browsers so you won't have to add the "If nothing shows" link.

Mike

princec

I'd go with a bit of Javascript if I were you and generate the best code dynamically depending on the browser.

Cas :)

jediTofu

Thanks everyone for the responses; I'll be considering the different options...
cool story, bro

pjohnsen

Just wanted to add that I've been using the Java Deployment Toolkit (http://download.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html) for a while and it works really well.

And basically it's one JS function call you need: runApplet, which takes care of everything (check that the right Java version is installed, write the most apropriate tag, etc.)

Just my 2 cents

-Pelle

Mickelukas

Do make a copy and put it on your server instead of reading it from Oracle. I used to use it but my applet was down twice due to it (once because of the java site being down and once because after an update to firefox it wasn't possible to run the script, it took SUN a month to fix it).

Mike

jediTofu

Thanks for the tip of storing the script.

I guess I'll go with the javascript route, but have a <noscript> tag for fall back with most likely the <applet> tag.  Seems like the best approach.

firefox and opera both can use the <object> tag flawlessly.  chrome/chromium chokes on it and will only use the applet tag (probably the same with IE).  I should probably just use the <object> tag and tell people to get a standards-compliant browser :>  but I won't be that mean.
cool story, bro