Inline jQuery for WebView won't work


Hi guys,

I wanted to include jQuery in a WebView by putting the jQuery source code inline, but I get this error:

chromium: [] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserStartupController( 2861): Initializing chromium process, singleProcess=true
chromium: [] locale_file_path.empty()
chromium: [] Load from apk succesful, fd=50 off=46184 len=3037
chromium: [] Loading webviewchromium.pak from, fd:51 off:229484 len:1089587
chromium: [] SPDY proxy OFF at startup
chromium: [INFO:CONSOLE(624)] “Uncaught SyntaxError: Unexpected token ?”, source: file:///data/data/org.nativescript.groceries/files/app/ (624)
chromium: [INFO:CONSOLE(10283)] “Uncaught TypeError: Cannot read property ‘fn’ of undefined”, source: file:///data/data/org.nativescript.groceries/files/app/ (10283)
chromium: [INFO:CONSOLE(10331)] “Uncaught ReferenceError: $ is not defined”, source: file:///data/data/org.nativescript.groceries/files/app/ (10331)

My problem is with the line that say Unexpected token ?, It pops up when I tried putting jQuery minified or uncompressed. If I replace inline jQuery with a cdn, it works. I copy pasted the code from the cdn to my code and it still doesn’t work. I think the issue is with the parsing, but I’m not sure.

Also, I need it to work offline, so using the CDN isn’t really an option as far as I know.

Please help me fix it.

My code is at:

Thank you


I guess I don’t understand why you are using jQuery in an Angular and / or NativeScript app. Are you sure this is the architecture you want to create your word cloud? What about using a WrapLayout with Labels, or some such?


Labels or other elements dont have rotate and similar things so its almost impossible to do but no need for jquery but depends


The problem was apparently the backslashes. Since jQuery included regex in its source code, the backslashes were being parsed in the HTML string. The fix was to replace all backslashes with a double backslash.