在Jquery中如何处理粘贴?
我有一个文本区域,在粘贴到该文本区域时我想
- 格式化粘贴值
- 附加到textarea
可以用Javascript完成吗?
Possible Duplicates:
How do you handle oncut, oncopy, and onpaste in jQuery?
jQuery catch paste input
I have a textarea, on paste to that textarea I want to
- format pasting values
- append to textarea
could that be done in Javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个在现代浏览器中有效的 onpaste 事件:
该事件有问题,它告诉您它将发生,但它不会告诉您用户正在粘贴的内容。 JavaScript 对剪贴板的访问受到限制,默认情况下它是禁用的。如果启用了访问权限,您可以读取剪贴板数据并对其进行操作。
There is an onpaste event that works in modern day browsers:
Problem with the event, it tells you that it is about to happen, but it doesn't give you what the user is pasting. JavaScript has restricted acccess to the clipboard and by default it is disabled. If the access is enabled you can read the clipboard data and than manipulate it.