Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Inject Javascript Function not working in Android React Native WebView but work fine in iOS React Native

For android, while adding the javascript function we need to add it as part of DOM. For that, replace `function` with `document` in jsCode.  
Ex:
let jsCode = `docuement.doPopUp() {
                        document.querySelector('#myBody').style.backgroundColor = 'red';
                        alert('hello world from webview');
                        }`;

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Inject #Javascript #Function #working #Android #React #Native #WebView #work #fine #iOS #React #Native
ADD COMMENT
Topic
Name
1+5 =