The normal way to execute a JavaScript code is to insert a
Script
tag
class containing JavaScript code in the UI. But, in some special cases like
server restart, there won't be a
BrowserPage
object so in such cases it's possible to push
ByteBuffer
returned by
BrowserPageAction.getActionByteBufferForExecuteJS
method which can execute the given JavaScript code in the browser.
Eg :- To execute an alert in the browser push the actionByteBuffer
to the client.
ByteBuffer actionByteBuffer = BrowserPageAction.getActionByteBufferForExecuteJS("alert('executed
script');");
Subscribe on youtube for technical videos