Java Android WebView - how to launch javascript function from a separate .js file? -
i don't know html , javascript , need start function javascript.
i've found can start javascript function mywebview.loadurl("javascript:function()"); if it's within html. i've got bunch of htmls in raw folder , separate script.js file works htmls. need start function script.js - do that?
put javascript.js file in same folder (raw) html files are. inside <head>
tag of html files import javascript files (if imported already, check if src
path inside <script>
tag correct), this:
<script type="text/javascript" src="javascript.js" ></script>
doing so, load in html, javascript functions contained in javascript.js file , can call mywebview.loadurl("javascript:function()");
successfully.
Comments
Post a Comment