How can I paste from clipboard using jQuery ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
回答2:
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);
回答3:
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!