How to Send Variables From JS into Go? #1667
-
|
Pass variables from //JS
window.runtime.EventsOn("ReceiveData", function(...args) {
console.log("Data from Go: ", ...args); // Data from Go: data from go
});//Go
runtime.EventsEmit(a.ctx, "ReceiveData", "data", "from", "go");I am not sure how to do the opposite way? JS => Go //JS
window.runtime.EventsOn("SendData" {
let stringFromJS = "Hello Go!";
return stringFromJS
});//Go
value := runtime.EventsEmit(a.ctx, "SendData"); //Of course it doesn't work this waySo how do I send a value from JS in Go? |
Beta Was this translation helpful? Give feedback.
Answered by
leaanthony
Jul 27, 2022
Replies: 1 comment 2 replies
-
|
Same way 😀 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
KiddoV
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same way 😀