开发者

Embedding a Java applet and provide installation option if Java is missing

What is the most user- and standard friendly way to embed a Java applet in a HTML page?

Is there something similar to Flash's swfobject that will gracefully degrade if Java 开发者_开发问答is not installed on the user's machine and give the user the alternative to install Java.


You can use the applet tag

From http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/using_tags.html#applet

<applet code=Applet1.class width="200" height="200">
Your browser does not support the <code>applet</code> tag.
</applet> 

The content of the tag will be shown if the applet can't be laoded


Hi just use the object tag. It's part of the HTML specification and works with most browsers.

The fallback with installation option is just writing some text in the tag.

Here is a usefull article on the subject:

http://depth-first.com/articles/2008/02/20/demystifying-java-applets-part-1-cross-browser-standards-compliant-pure-html-deployment-using-the-object-tag

Regards

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜