我可以在 Google Wave 小工具中嵌入 Java 小程序吗?
如果是这样,有人可以给我指出一个例子吗?或者甚至一些代码?!
我猜我不能,因为使用以下内容嵌入小工具中的小程序......
var div = document.getElementById('content_div');
div.innerHTML =
"<applet CODE='http://www.echoecho.com/lake.class' width='370' height='200'>
<param name='image' value='http://www.echoecho.com/sunset.gif' />
</applet>"
不起作用。也许我过度简化了小工具代码?
** 更新... 我的下一次尝试如下,但仍然没有运气...
...
<script src="http://java.com/js/deployJava.js"></script>
<script>
...
// end of code copied from Google's basic counter gadget...
gadgets.util.registerOnLoadHandler(init);
var attributes = {
code:'http://www.....co.uk/wave/applets/DrawingLines.class',
width:'300',
height:'300'} ;
deployJava.runApplet(attributes);
</script>
<input type=button value="Click Me!" id="butCount" onClick="buttonClicked()">
<input type=button value="Reset" id="butReset" onClick="resetCounter()">
]]>
</Content>
</Module>
我只是收到带有顶部错误的 Java 错误框:“load: class http://www.....co.uk/wave/applets/DrawingLines.class 未找到。”。
If so, can someone point me in the direction of an example? Or even some code?!
I'm guessing that I can't as the applet embedded in a gadget using the following...
var div = document.getElementById('content_div');
div.innerHTML =
"<applet CODE='http://www.echoecho.com/lake.class' width='370' height='200'>
<param name='image' value='http://www.echoecho.com/sunset.gif' />
</applet>"
... doesn't work. Maybe I'm over-simplifying the gadget code?
** UPDATE...
My next attempt was the following, and still no luck...
...
<script src="http://java.com/js/deployJava.js"></script>
<script>
...
// end of code copied from Google's basic counter gadget...
gadgets.util.registerOnLoadHandler(init);
var attributes = {
code:'http://www.....co.uk/wave/applets/DrawingLines.class',
width:'300',
height:'300'} ;
deployJava.runApplet(attributes);
</script>
<input type=button value="Click Me!" id="butCount" onClick="buttonClicked()">
<input type=button value="Reset" id="butReset" onClick="resetCounter()">
]]>
</Content>
</Module>
I just get Java error box with the top error: "load: class http://www.....co.uk/wave/applets/DrawingLines.class not found.".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://jameswilliams.be/blog/entry/158 似乎可以使用
部署Java.runApplet
。这是 2009 年 10 月的事情,所以我不知道 API 是否有很大变化:http://jameswilliams.be/blog/entry/158 appears do accomplish this using
deployJava.runApplet
. This was from October 2009, so I don't know if the API has changed much: