开发者

Whether hotlinking of java applets is possible?

Similar question had been added earlie开发者_如何学编程r: How to embed a Java Applet from another website (can't link their class file and jar)

however someone who asked question didn't need hotlinking in fact.

My applet will not be able to run in other environment than own.

Whether iframes are my last hope?


Hosting an applet from another web site can be as easy as setting an appropriate codebase attribute. E.G. The properties applet at my site (view the HTML source for the gory details) can be launched locally (or from another site) using this HTML.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<title>
Property Probe - applet
</title>
<script type='text/javascript' src="http://www.java.com/js/deployJava.js">
</script>
<script type='text/javascript'>
var attributes = {
    code:'org.pscode.tool.property.PropertyProbe',
    codebase:'http://pscode.org/lib',
    archive:'propprobe.jar',
    id:'applet',
    scriptable:'true',
    width:'600',
    height:'300'
};
var version = '1.2';
var params;
</script>
</HEAD>
<BODY>
<script type='text/javascript'>
deployJava.runApplet( attributes, params, version );
</script>
</BODY>
</HTML>

It will run into problems if the applet expects to find (non class) resources relative to the document base, as opposed to the code base.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜