diff --git a/doc/js_tutorials/js_setup/js_usage/js_usage.markdown b/doc/js_tutorials/js_setup/js_usage/js_usage.markdown index 7992fd4096..c543b5dd79 100644 --- a/doc/js_tutorials/js_setup/js_usage/js_usage.markdown +++ b/doc/js_tutorials/js_setup/js_usage/js_usage.markdown @@ -122,11 +122,14 @@ imgElement.onload = function() { mat.delete(); }; -function onOpenCvReady() { - document.getElementById('status').innerHTML = 'OpenCV.js is ready.'; -} +var Module = { + // https://emscripten.org/docs/api_reference/module.html#Module.onRuntimeInitialized + onRuntimeInitialized() { + document.getElementById('status').innerHTML = 'OpenCV.js is ready.'; + } +}; - + @endcode