📜  注入 Javascript 函数在 Android React Native WebView 中不起作用,但在 iOS React Native 中工作正常 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:49.955000             🧑  作者: Mango

代码示例1
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');
                        }`;