Skip to content

Call functions from JS

Dmitriy edited this page Jul 23, 2024 · 6 revisions

Example

Python

def test_function(arg1):
    print(arg1)

app.bind(test_function)

C++

app.bind("test_function", []() -> void {
    std::cout << "Hello world!" << std::endl;
});

JavaScript

function test_call() {
    webview.invoke('test_function', 1);
}
Clone this wiki locally