This post explains how to call Javascript from Java. The code example is available
at GitHub in the Java-Javascript-Calling directory.
Code Example
We create some small Javascript code in a string. This code dumps "Hello World!" and defines a function called myFunction() adding 3 to the provided value:
public class JavascriptCalling {
public static final String MY_JS
= "print("
Leave a Reply