Read the client clipboard with jQuery?

2019-02-18 20:00发布

Is it possible to get/read the clipboard of a client with jQuery?

(I need get the information of a spread sheet and paste this information in a jqGrid web grid...)

3条回答
我想做一个坏孩纸
2楼-- · 2019-02-18 20:23

I did a workaround to accomplish the request. Basically I included a TextBox object into my Web Form with the legend "Paste your information [Here]. Using CTRL + V". Then, I read the event pressKey with jQuery (reading CTRL + V combination), then I can read the clipboard data in the TextBox.

查看更多
放荡不羁爱自由
3楼-- · 2019-02-18 20:30

Well according to this similar SO question it cannot be done with just JavaScript. Which is good, because it would be a major security risk. You need a small flash object to get the functionality you want.

In any way, this is a duplicate question.

查看更多
Rolldiameter
4楼-- · 2019-02-18 20:42

Does DataDrop – Drag Grid Data in From a Spreadsheet help? It would be drag & drop instead of reading the clipboard, but reading the clipboard is difficult to impossible.

查看更多
登录 后发表回答