Closed iiiypuk closed 1 year ago
I guess you are using local HTML files, So, you need to add <script src="/webui.js"></script>
.
See this documentation for more details: https://webui.me/docs/#/c_api?id=examples
Sorry, I just saw that you already added it... let me try it.
WebUI API are currently in deep changes. Since your using non tagged version the doc is not up to date. The current client side API is here.
WebUI client is acessible under webui
global object. You can use complemention and doc using typescript with:
import type webui from "https://raw.githubusercontent.com/webui-dev/webui/main/src/client/webui.ts"
declare global {
const webui: webui
}
Or by adding reference in a js file in your project tsconfig.
You can see live client status by using JSDoc viewer like doc.deno.land under "Methods" section.
@iiiypuk I recommend using the stable version for now. The current commits are not fully functional.
Fine. Thank you for the explanations.
I get an error when I try to call C code from JS. Error in this code line
webui_fn('MyID', text).then((response) => { console.log(response); });
Bind by ID is working
void fn_two();
All examples from the repository library that call the JS function
webui_fn()
do not work.Code
System
webui version: latest edf5eeae65fdf2568303cdb8198e35b5bd01a769 os: archlinux gcc version: 13.1.1