Inherits: Object

Singleton that connects the engine with the browser’s JavaScript context in HTML5 export.


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.


Varianteval ( String code, bool use_global_execution_context=false )

Method Descriptions

Execute the string code as JavaScript code within the browser window. This is a call to the actual global JavaScript function eval().

If use_global_execution_context is true, 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.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.