Mobile Development 10.11 | webMethods Mobile SuiteWeb Help | webMethods Mobile Designer Native User Interface Reference | Mobile Designer Native User Interface | JavaScript Bridge | Evaluating an Arbitrary Chunk of JavaScript Code
 
Evaluating an Arbitrary Chunk of JavaScript Code
With callJavaScript(), messages are passed from Java into an existing method hosted on the JavaScript side. Sometimes, this can be unsuitable for the application, and only a few simple lines of JavaScript need to be evaluated. For this, the method evaluateJavaScript() can be called.
As with callJavaScript(), there are two ways to call evaluateJavaScript(). One is to take a string containing the JavaScript code, run synchronously, and return a string result (if applicable). The other method will take an additional object conforming to com.softwareag.mobile.runtime.nui.IJSCallback, and run asynchronously, returning any result at a later time.