2 ms·
I've been calling into the Javascript runtime from C# in Blazor. (C# compiles to WASM.) Blazor's built-in framework appears to send HTML (as a string) to the D
by gwbas1c 5y ago
I've been calling into the Javascript runtime from C# in Blazor. (C# compiles to WASM.)
Blazor's built-in framework appears to send HTML (as a string) to the DOM. It also automatically sets up callbacks from DOM events into C#.
For code that I've written, I've mostly done simple stuff, like calling window.alert. I suspect I could call window.getelementbyid using the same techniques, but I haven't done that yet.
I did try manipulating the DOM from Rust (via WASM) in the summer of 2020. That was an exercise in frustration, but I point my finger equally at the language and the runtime. Granted, a lot can change since then!