Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<applet> vs <object>

Just out of curiosity, between <applet> vs <object> for a Java applet, which one should I use? I know that <applet> is deprecated, however Sun still recommends the use of <applet>.

Is there any drawback between the two tags? Because when I use <object> for Mac in Safari, it causes a problem saying that the page can't load, even though the page loaded properly, and when I check the activity window it said that the class was not found/cancelled. For example:

enter image description here

like image 323
Harts Avatar asked Apr 09 '12 16:04

Harts


2 Answers

Use applet if you have found that it works more often. The object element was introduced as a theoretical unification that would be a catch-all for any embedding of external data. It never worked well, and modern HTML development has effectively abandoned the unification idea. HTML5 introduces audio and video, for example and keeps img (logical unification would surely deprecate img, because an image can be embedded with object).

like image 57
Jukka K. Korpela Avatar answered Oct 05 '22 07:10

Jukka K. Korpela


Use deployJava.js as mentioned in the applet info. page..

..To avoid browser compatibility issues, the Deployment Toolkit script provides JavaScript functions that automatically generate the HTML required to deploy RIAs. Developers should invoke these functions to deploy their solutions in a consistent fashion across various browsers.

Then you don't have worry about whether the script writes an applet, object or embed element.


As an aside. Copy/pasting the text from the Activity window would be a lot more useful than a screen-shot. Now I look (squint) at it, it seems the only two lines of output that are in any way relevant are:

  • http://admin.file-lift.com/css/none not found
  • http://admin.file-lift.com/com.pspinc.util.FileUploaderApplet.class cancelled

The css/none is not a class or a Jar, and neither of them exist on the server. So that applet has problems beyond the HTML elements used to deploy it.

like image 23
Andrew Thompson Avatar answered Oct 05 '22 07:10

Andrew Thompson