Java API
Deprecation noticeCheerpJ 2 is deprecated. Consider migrating to CheerpJ 3 .
An additional jar (cheerpj-dom.jar
) in the CheerpJ downloadable archive has been provided to allow interactions with the browser DOM directly from Java.
This JAR provides declarations for all of the relevant Java interfaces and classes. In particular you will find them wrapped in the com.leaningtech.client
package, for example the Document
interface of the browser (documented here) becomes com.leaningtech.client.Document
with CheerpJ.
The com.leaningtech.client.Global
is a representation of the global namespace in the browser context. It only contains static methods and fields.
Usage examples can be found at DOM and JavaScript interoperability.
Global.JSString
Converts a Java String to a JSString.
Global.JavaString
Converts a JSString to a Java String.
Global.jsCall / jsCallI / jsCallD / jsCallS
Calls an arbitrary JavaScript function.
Method | Parameters | Output |
---|---|---|
jsCall | String funcName, Object… arg | Object |
jsCallI | String funcName, Object… arg | Int |
jsCallD | String funcName, Object… arg | Double |
jsCallS | String funcName, Object… arg | JSString |