Paste from clipboard

2019-05-03 07:31发布

How can I paste from clipboard using jQuery ?

3条回答
我只想做你的唯一
2楼-- · 2019-05-03 08:26

I don't think you can do this using javascript. Since clipboard data is part of the operating system your javascript code ill not be able to access that.

查看更多
太酷不给撩
3楼-- · 2019-05-03 08:26

It may be possible in some browsers/environments using document.execCommand, but shouldn't be relied on and you're better off finding another solution.

For posterity:

document.execCommand('paste', false, null);
查看更多
SAY GOODBYE
4楼-- · 2019-05-03 08:29

There is a very good JS / Flash library for this:

Zero Clipboard

Its currently the only libaray which handles the latest flash plugin 10 as well!

查看更多
登录 后发表回答