开发者

"Paste" button for a textfield using jQuery

I am using Ruby on Rails 3.0.7 and jQuery 1.6.1. I would like to add a button in a form in order to paste in a its field a text previously memorized. 开发者_运维技巧That is, I would like that a user that copied a text from somewhere then have the possibility to click on the above mentioned button so that his/her copied text will populate a textfield.

How can I do?


for IE , you can grab the clipboard data .

var clipboarddata = window.clipboardData.getData('Text');


I think you can only access the clipboard in IE.

For other browsers, you need to interface with a Flash object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜