Home
Sign Up
Sign In
V2EX
›
Android
安卓 WebView 中如何获取用户当前选中的字符串
ttxxyy112233
·
Mar 22, 2018
· 13423 views
This topic created in 3019 days ago, the information mentioned may be changed or developed.
用了 window.getSelection().toString()还是不行,不知道是什么情况
tsel
ecti
toString
WebView
3 replies
•
2018-03-23 10:22:47 +08:00
1
crystom
Mar 22, 2018
浏览器不支持,很正常
2
ttxxyy112233
OP
Mar 22, 2018 via Android
@
crystom
原来是浏览器的问题吗 😂
3
lukunlin
Mar 23, 2018
前端问题的话就没必要来 V2 了吧,百度不是一大堆吗~
一般使用 input 的 DOM 对象去调用 select 方法后,使用 document.execCommand("Copy")就可以把选中的内容复制到剪贴板了
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
930 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 6b34f497 · 50ms ·
UTC 22:46
·
PVG 06:46
·
LAX 15:46
·
JFK 18:46
♥ Do have faith in what you're doing.
❯