We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a94135 commit 1fed94bCopy full SHA for 1fed94b
README.md
@@ -59,6 +59,7 @@ Download the latest version of [c2wasm.c](https://github.com/OUIsolutions/C2Wasm
59
Create a `test.c` file in the same directory where you saved `c2wasm.c`:
60
61
```c
62
+
63
#include "c2wasm.c"
64
#include <stdio.h>
65
@@ -69,7 +70,12 @@ long set_div_value() {
69
70
71
// Get the DOM element with id "test_div"
72
c2wasm_js_var element = c2wasm_call_object_prop(c2wasm_document, "getElementById", find_args);
73
+ if(c2wasm_instance_of(element, c2wasm_error)) {
74
+ printf("Error: Element not found\n");
75
+ return c2wasm_undefined;
76
+ }
77
78
79
// Set the innerHTML of the element
80
c2wasm_set_object_prop_string(element, "innerHTML", "Hello World from C");
81
0 commit comments