Java & # 8596; Javascript for non-applets?

I am working with an existing Java codebase, which although it can be called from an HTML page using the <APPLET> tag, does not actually subclass the Applet class. The same banks are also used in a context without a browser, so they did not subclass Applet.

Now I need to pass some values ​​from Java back to the Javascript of the calling page. This can usually be done using JSObject, but as far as I can, I need to use JSObject.getWindow, which works only for subclasses of Applet.

Whether there is a:

  • How to use JSObject from something that is not a subclass of Applet?
  • is there any other mechanism for linking to the javascript of the calling page?
+3
source share
3

, jar, . , lib , Java.

+2

JSObject.getWindow(this) . JSObject , .

+3

?

Javascript Java- getElementById ( "id-of-embed-tag" ). . Java, , Javascript.

+1

Source: https://habr.com/ru/post/1699529/


All Articles