Clipbaord.data无法正常工作 [英] Clipbaord.data is not working

查看:105
本文介绍了Clipbaord.data无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hai,

i需要在jquery中从剪贴板中复制值。

但我不能这样做



我尝试过:



hai,
i need to get copied value from clipboard in jquery.
but i can't do this

What I have tried:

var content = clipboard.getData("Text");
  alert(content);

推荐答案

该代码仅适用于某些版本的Internet Explorer,且仅限用户同意与您的网站分享他们的剪贴板内容。



在Chrome,Opera和Firefox中,您只能阅读或修改剪贴板内容以响应用户操作。



这是出于安全考虑。想象一下,例如,如果您将您的网上银行登录详细信息复制到剪贴板,然后转到随机网站。您希望该网站能够访问剪贴板的内容吗?



我可以使用...剪贴板API [ ^ ]
That code will only work in certain versions of Internet Explorer, and only if the user agrees to share the content of their clipboard with your site.

In Chrome, Opera and Firefox, you can only read or modify the clipboard content in response to a user action.

This is for security reasons. Imagine, for example, if you'd copied your online banking login details to the clipboard, and then went to a random website. Would you want that site to be able to access the content of your clipboard?

Can I use... Clipboard API[^]


Quote:

但我只会复制excel数据

but i'll copy only excel datas



尝试 ZeroClipboard [ ^ ]用于 Handsontable [ ^ ]


这篇关于Clipbaord.data无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆