Category : javascript

im doing a js course in YouTube and i get this error "Uncaught TypeError: this.model.addTodo is not a function ", here is my code: export default class View { constructor() { this.model = null; this.table = document.getElementById(‘table’); const btn = document.getElementById(‘add’); btn.onclick = () => this.addTodo(‘Titulo’, ‘Desc’); } setModel(model) { this.model = model; } addTodo(title, ..

Read more

My web app sends browser notifications, and I know how to check the browser permission for the notifications, and how to request permissions if they are not granted. However, even if the user granted permission for my site to send notifications, she might still not get the notifications, because they might be disabled (either globally ..

Read more

I’m working on binding a simple c++ class into javascript. I’m doing this via Emscripten 2.0.17. I bound hello_world.cpp #include <iostream> class hello { public: hello() { std::cout << "Hello world!!!n"; } }; #include <emscripten/bind.h> namespace emcc = emscripten; EMSCRIPTEN_BINDINGS(jshello) { emcc::class_<hello>("hello") .constructor<>(); } using this command from terminal ./emcc_path/emcc –bind hello_world.cpp -o world.html Then ..

Read more