Import Javascript on every page displayed on my Android WebView
Guys i've looked so much for that on the Internet but i didn't find anything relevant. My problem is: i want to load several HTML pages on my Android WebView, but for each of those i want to automatically load two or more javascript files (JQuery scripts). How can i d开发者_运维百科o it? I have no possibility of changing the HTML pages.. Thanks a lot in advance !
You can read the file and execute it directly via loadUrl("javascript: your_script )
@Override
public void onPageFinished(WebView view, String url)
{
webview.loadUrl("javascript: your_script");
}
精彩评论