2.41 :runscript()
This method allows JavaScript to be executed in the browser engine. This enables access to content or manipulation of HTML objects. Messages resulting from the JavaScript execution can be disabled using the .disable_messages attribute.
Definition
void :runscript
(
string Script input
)
This method can only be called for a visible dmw_webview object; otherwise, it will generate a call error.
Parameters
- void Script input
- A JavaScript to be executed.
Return value
None.
Example
Example of displaying the current date using JavaScript:
dmw_webview Wv {
.html "<!DOCTYPE html><html><body><h1>JavaScript Sample</h1>
<p id=\"demo\"></p></body></html>"
}
Wv:runscript("document.getElementById('demo').innerHTML = Date()");
Objects with this method
Object dmw_webview