I would like to change the Uri tapped on the webView and load it.
Specifically, I would like to load the one with the JavaScript argument removed from the Uri link.
For example,
<a href="http://example.com/index.html?id=hoge">
In the case of html, I would like to have index.html read instead of index.html?id=hoge.How can I achieve this?
android android-webview
If you remove the URL argument in Javascript: link.split('?')
removes arguments from the best ?
:
<body>
<a href="http://example.com/index.html?id=hoge">link to example.com</a>
</body>
<script>
varlink = document.getElementsByTagName("a")[0].href;
document.getElementsByTagName("a")[0].href=link.split('?')[0];
</script>
© 2024 OneMinuteCode. All rights reserved.