在没有 loadUrl() 的情况下在 android WebView 中加载 javascript
我需要在 android web 视图中运行一些 javascript。我知道通过加载 javascript: url 可以很好地工作。似乎当我这样做时,网络视图中选定的文本已被清除。我正在运行的 JavaScript 获取所选文本的范围,因此我需要它保持选中状态。
如何在不丢失选择的情况下运行 javascript?
I need to run some javascript in an android web view. I understand this works fine by loading a javascript: url. It seems that when I do that though the selected text in the web view is cleared. The javascript I'm running gets the range of the selected text, so I need it to remain selected.
How can I run the javascript without losing the selection?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要使您的 webview 能够运行 Javascript,请执行以下操作:
to make your webview be able to run Javascript do this: