js: Uncaught ReferenceError: xxx is not defined
Unsolved
QtWebEngine
-
wrote on 19 Jul 2020, 09:31 last edited by
I try to run some simple sample code that use webengine to load html file and run js function embeded in html file. But the console show that js: Uncaught ReferenceError: xxx is not defined. xxx is js function.
-
wrote on 19 Jul 2020, 09:42 last edited by
-
wrote on 22 Feb 2021, 06:56 last edited by
There is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this 'x' is not defined error . This usually indicates that your library is not loaded and JavaScript does not recognize the 'x'.
To solve this error: Load your library at the beginning of all your scripts.
There can be multiple other reasons for this issue:
- Added JavaScript library after the script were you see that error
- Conflict with Other JavaScript Libraries
- Path to JavaScript library you included is not correct
- The jQuery library file is corrupted
- May be a chance where you are working offline