Read the client clipboard with jQuery?

♀尐吖头ヾ 提交于 2019-12-01 06:21:56

问题


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...)


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/4744621/read-the-client-clipboard-with-jquery

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!