webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and modern web technologies in the frontend, all in a lightweight portable library.
https://webui.me
MIT License
2.96k stars 172 forks source link

console.log(type(index)); Will cause the function to not run #314

Closed SnowMeteors closed 8 months ago

SnowMeteors commented 8 months ago
std::string js = R"(cppModifyHostRow(-1,-2);)";
my_window.run(js.c_str());
function cppModifyHostRow(index,a) {
        console.log(type(index));
        console.log(index);
        if (index === -1) {
            console.log("asdf");
        }
        console.log(a);

    }
}

result image After commenting out console.log image

SnowMeteors commented 8 months ago

Sorry, I made a mistake in my code. It should be console. log (typeof (index))