2018-09-07 android webview 网页动态插
2018-09-07 本文已影响0人
dizziness
android webview 网页动态插入javascript的正确姿势
String js = "var script = document.createElement('script');";
js+= "script.type = 'text/javascript';";
js+="script.src = '"+data.getMsg_js_url()+"';";
js+="document.body.appendChild(script);";
String finalJs = js;
view.loadUrl("javascript:"+ finalJs);