Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Regular Contributor
mja1986
Posts: 53
Registered: ‎08-27-2013
My Device: none

ScriptException: No detail message

Hello!

 

I've got my BrowserField, I've got some HTML and JavaScript loaded, I do have a JavaScript function that should be executed via:

public void executeJS(String javascript) {
try {
ScriptEngine engine = mdBrowserField.getScriptEngine();
Object script = engine.compileScript(javascript);
engine.executeCompiledScript(script, null);
} catch (Throwable e) {
e.printStackTrace();
}
}

 

but this only produces: 

[5609.453] ScriptException
[5609.453] No detail message
[5609.453] net_rim_bb_browser_olympia-3(4EC5E80F)
[5609.468] DOMDataReader
[5609.468] readScriptObject
[5609.468] 0x295F
[5609.468] net_rim_bb_browser_olympia-4(4EC5E80F)
[5609.492] OlympiaScriptEngine
[5609.492] executeCompiledScript
[5609.492] 0x6EB6

The javascript string looks like this: "functionThatsAlreadyBeenDefined(\"" + base64String + "\");"

I also tried: "window.functionThatsAlreadyBeenDefined(\"" + base64String + "\");"

and: "window.functionThatsAlreadyBeenDefined(\"" + base64String + "\");"

all the same...

 

Thanks in advance!

Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: ScriptException: No detail message

I'm not sure what the issue is, but my guess is the compileScript() piece.

 

Try this instead?

 

ScriptEngine engine = mdBrowserField.getScriptEngine();
engine.executeScript("functionThatsAlreadyBeenDefined('" + javascript + "')", null);

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Regular Contributor
mja1986
Posts: 53
Registered: ‎08-27-2013
My Device: none

Re: ScriptException: No detail message

Thanks, as stated in http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/script/ScriptEngine.html#execu... this wouldn't make any difference other than to hide the point of failure  (which is executeCompiledScript, compileScript seems to work just fine)

 

And the current state of development regarding this issue is to be found here:
http://supportforums.blackberry.com/t5/Java-Development/ScriptException-No-detail-message/td-p/26220...