JavaScript not working in Android Webview?
FIXED!
Spurred on by the error, I found out that I needed to set
setDomStorageEnabled(true)
for the webview settings.
Thanks for your help Stephan :)
Javascript not working in a WebView Activity
Set this setting as well for your webView:
WebSettings settings = webView.getSettings();
settings.setDomStorageEnabled(true);
For Detail refer to answer in the following link:
ERROR/Web Console: Uncaught TypeError: Cannot call method 'getItem' of null at http://m.youtube.com/:844
Update:
or adding this might help:
webView.loadDataWithBaseURL("fake://fake.com", myString, "text/html", "UTF-8", null);
Android WebView not loading javascript files or functions even after enabling javascript
I can't figure out the problem with the Nox Player, but I am able to have it worked in Vivo 11, and Vivo 11 Pro which has Funtouch OS 4.5 (based on Android 8.1) also the android emulator. Initially when I installed the app the webview showed the error 'net:ERR_CLEARTEXT_NOT_PERMITTED'. Then I added this line in manifest file 'android:usesCleartextTraffic="true"' in the 'application' tag and it worked without any issues. all the javascript files/functions are loading properly. Thanks everyone for the inputs.
Related Topics
Grabbing Style.Display Property via Js Only Works When Set Inline
Jquery Ajax, Wait Until Beforesend Animation Finishes
JavaScript Invalidcharactererror When Modifying a CSS Name with a Space
Bootstrap Dropdown Checkbox Select
Disable Inertia Scroll for "Single-Page" Webapp
Disable (Exclude) Bootstrap for One Div on a Page
Get CSS Not-Computed Property-Value with JavaScript Only
Turn Off CSS3 Animation with Jquery
How to More Accurately Measure Svg Text Height
Angular - Ngfor* Four Elements on Row
How to Copy Multiple Files and Keep the Folder Structure with Gulp
Make the Change of "Active" Class in the Menu More Reliable When Scrolling
Apply CSS to Active Router Link [Angular 2]
Bootstrap 3 Popover Arrow and Box Positioning
Using Variables in Gulp for the Destination File Name
Stop Infinite CSS3 Animation and Smoothly Revert to Initial State