Putting applets into a HTML, but how? -
i wrote applet called "idrawapplet.java" , html supposed contain applet. somehow when run html says can't find java-class. "dynamic-web-project". has "webcontent"-folder contains both, html , java-class.
as see tried insert applet in 2 different ways. putting in "applet"-tag , "object"-tag (as suggested) on selfhtml.org:
<!-- <applet code= "idrawapplet.class" codebase= "../applets" width= 320 height= 180></applet> --> <object classid="java:idrawapplet.class" codebase="../applets" width="800" height="600"></object> thanks in advance...
the proper way (which html5 way) embed java applet is:
<object type="application/x-java-applet" width="320" height="180"> <param name="code" value="myjavaclass"> fallback content </object> however, ie doesn't support standard way need use ie conditional comments (in html5-compatible way) this:
<!--[if !ie]>--> <object type="application/x-java-applet" width="320" height="180"> <param name="code" value="myjavaclass"> fallback content </object> <!--<![endif]--> <!--[if ie]> <object classid="clsid:8ad9c840-044e-11d1-b3e9-00805f499d93" width="320" height="180"> <param name="code" value="myjavaclass"> fallback content </object> <![endif]--> note value of code param, doesn't require .class extension. class name preferable.
for ie, can specify codebase attribute if want provide location cab file ie can fetch java if don't have it. however, if want specify path directory .class file in, (for browser) codebase param.
as enabling scripting "mayscript", shouldn't need these days. but, if need reason, mayscript param (not attribute) , set value true.
note fallback content show when handler application/x-java-applet isn't present or disabled. won't show missing .class file java plug-in still loads.
Comments
Post a Comment