开发者

Java to JavaScript communication

开发者 https://www.devze.com 2023-01-16 12:20 出处:网络
I want to access HTML elements from within my Java applet. Like I want to do following: Pass a value of text box to applet

I want to access HTML elements from within my Java applet. Like I want to do following:

  1. Pass a value of text box to applet
  2. From applet I want to set some text inside an HTML page. Like applet takes some input from text box. Does processing and then print output as href on HTML page.

How can i do this?

I heard of some java library: http://java.sun.com/products/plugin/1.3/do开发者_运维知识库cs/jsobject.html.

But where can i download it from?


I think those links take you to the current documentation:

http://docs.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html

https://developer.mozilla.org/en/JavaScript/Guide/LiveConnect_Overview

According to those documents, since Java 1.4 the classes to communicate with Javascript are inlude in the JRE, in lib/plugin.jar.


You can use Rhinohide. Here's a demo that does exactly what you want Events_2_Demo.

0

精彩评论

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

关注公众号