Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript Bridge Does Not Work #9876

Open
Mixddux opened this issue Aug 31, 2024 · 0 comments
Open

JavaScript Bridge Does Not Work #9876

Mixddux opened this issue Aug 31, 2024 · 0 comments
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation bug

Comments

@Mixddux
Copy link

Mixddux commented Aug 31, 2024

Version 4.3

I cannot get data to transfer from a javascript variable to godot variable. Documentation is inadequate and provides no examples.

The use-case is using JavaScript I download a JSON file from API in on WebGL platform. The variable is playerId = "1234". I should be able to use JavaScriptBridge in GDScript to create a new variable:

var Player = JavaScriptBridge.create_object("String", "playerId")

Now the variable is in GDScript, I can use it through the game and display it on the UI. For example:

label.text = "Your ID: ", Player

and it should display Your ID: 1234

I know there's another issue like this, but it's labeled as a feature request. This is a bug because the documentation says this is supposed to work and it doesn't.

Please fix this.

JavaScript number is returned as [:ref:class_float](https://github.com/godotengine/godot-docs/blob/4.3/tutorials/platform/web/javascript_bridge.rst#id13) JavaScript boolean is returned as [:ref:class_bool](https://github.com/godotengine/godot-docs/blob/4.3/tutorials/platform/web/javascript_bridge.rst#id15) JavaScript string is returned as [:ref:class_String](https://github.com/godotengine/godot-docs/blob/4.3/tutorials/platform/web/javascript_bridge.rst#id17)

URL to the documentation page:

@Mixddux Mixddux added the bug label Aug 31, 2024
@skyace65 skyace65 added the area:manual Issues and PRs related to the Manual/Tutorials section of the documentation label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation bug
Projects
None yet
Development

No branches or pull requests

2 participants