Browser::execute: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "This function used for call JavaScript code in created browser. ==Syntax== <syntaxhighlight lang="typescript"> void browser.execute(string executedCode); </syntaxhighlight>...")
 
m (Removed typing example, updated page.)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This function used for call JavaScript code in created browser.
{{ClientsideJsFunction}}
Calls JavaScript code inside the browser.


{{JSContainer|
==Syntax==
==Syntax==
<syntaxhighlight lang="typescript">
<pre>
void browser.execute(string executedCode);
browser.execute(executedCode);
</syntaxhighlight>  
</pre>  
===Required Arguments===
===Required Arguments===
*'''executedCode:''' JavaScript code what will be executed in browser.
*'''executedCode:''' JavaScript code to be executed in browser.


==Example==
==Example==
That's example made nothing useful.
Create a popup alert in the browser
<syntaxhighlight lang="javascript">
{{ClientsideCode|
<pre>
browser.execute(`alert(\`It's a test.\`);`);
browser.execute(`alert(\`It's a test.\`);`);
</syntaxhighlight>
</pre>
}}
}}


==See Also==
==See Also==
{{WebBrowser_function_c}}
{{Browser_definition_c}}
[[Category:Clientside API]]

Latest revision as of 22:33, 20 April 2020

Client-Side
Function

 JavaScript



Calls JavaScript code inside the browser.

JavaScript Syntax

Syntax

browser.execute(executedCode);

Required Arguments

  • executedCode: JavaScript code to be executed in browser.

Example

Create a popup alert in the browser

Client-Side
browser.execute(`alert(\`It's a test.\`);`);


See Also