js_url_string = js_url_string +
" var script=document.createElement('script'); "
+ " script.setAttribute('type','text/javascript'); "
+ " script.setAttribute('src', '"
+ js_url[i]
+ "'); "
+ " script.onload = function() {"
+ funcPtr + ";"
+ "};"
+ " document.getElementsByTagName('head')[0].appendChild(script); ";
myWebView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
view.loadUrl("javascript:(function() { "
+ js_url_string
+ "})()");
}
});
Reference links
http://stackoverflow.com/questions/8227612/how-to-create-document-objects-with-javascript
http://www.javascriptkit.com/javatutors/dom2.shtml
沒有留言:
張貼留言