You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
For the time being we don't support writing a description for those, preferring
having all details in the method's description.
Using self-closing tags saves half the lines, and prevents contributors from
thinking that they should write the argument or return documentation there.
(cherry picked from commit 7adf4cc9b5)
27 lines
1.7 KiB
XML
27 lines
1.7 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="JavaScript" inherits="Object" version="3.3">
|
|
<brief_description>
|
|
Singleton that connects the engine with the browser's JavaScript context in HTML5 export.
|
|
</brief_description>
|
|
<description>
|
|
The JavaScript singleton is implemented only in the HTML5 export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs.
|
|
[b]Note:[/b] This singleton can be disabled at build-time to improve security. By default, the JavaScript singleton is enabled. Official export templates also have the JavaScript singleton enabled. See [url=https://docs.godotengine.org/en/3.3/development/compiling/compiling_for_web.html]Compiling for the Web[/url] in the documentation for more information.
|
|
</description>
|
|
<tutorials>
|
|
<link>https://docs.godotengine.org/en/3.3/getting_started/workflow/export/exporting_for_web.html#calling-javascript-from-script</link>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="eval">
|
|
<return type="Variant" />
|
|
<argument index="0" name="code" type="String" />
|
|
<argument index="1" name="use_global_execution_context" type="bool" default="false" />
|
|
<description>
|
|
Execute the string [code]code[/code] as JavaScript code within the browser window. This is a call to the actual global JavaScript function [code]eval()[/code].
|
|
If [code]use_global_execution_context[/code] is [code]true[/code], the code will be evaluated in the global execution context. Otherwise, it is evaluated in the execution context of a function within the engine's runtime environment.
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
<constants>
|
|
</constants>
|
|
</class>
|