summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/@GlobalScope.xml2
-rw-r--r--doc/classes/JavaScript.xml30
2 files changed, 32 insertions, 0 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 31a0d3ccef..d9bdf0e3cf 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -44,6 +44,8 @@
<member name="JSON" type="JSON" setter="" getter="">
[JSON] singleton
</member>
+ <member name="JavaScript" type="JavaScript" setter="" getter="">
+ </member>
<member name="Marshalls" type="Reference" setter="" getter="">
[Marshalls] singleton
</member>
diff --git a/doc/classes/JavaScript.xml b/doc/classes/JavaScript.xml
new file mode 100644
index 0000000000..9dd386f08e
--- /dev/null
+++ b/doc/classes/JavaScript.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="JavaScript" inherits="Object" category="Core" version="3.0-alpha">
+ <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 HTML5 export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs.
+ </description>
+ <tutorials>
+ http://docs.godotengine.org/en/stable/learning/workflow/export/exporting_for_web.html#calling-javascript-from-script
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="eval">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="code" type="String">
+ </argument>
+ <argument index="1" name="use_global_execution_context" type="bool" default="false">
+ </argument>
+ <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>