【发布时间】:2019-02-27 10:01:35
【问题描述】:
我已将此 js 注入 webview。 :
var msgP = document.createElement('p');
msgP.setAttribute('id', 'msgLabel');
msgP.setAttribute('style', 'color:red');
msgP.innerHTML = '{0}';
msgP.onclick = function() {window.postMessage('some Data'); }
document.querySelector('#login-form').appendChild(msgP);
以上代码仅在启用调试模式时有效!
【问题讨论】:
标签: android react-native webview