Calling Javascript From Java (Example)

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("


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *