I'm trying to detect when the user presses Ctrl + V in JavaScript.
jQuery(document).on('paste', function() {alert('text pasted!')})
It works well with Chrome (v37). But it does not work with Firefox (v32) and IE (v11), as you can try on this jsfiddle:
http://jsfiddle.net/7N6Xq/410/
Any idea what I'm doing wrong?
EDIT - 2014-09-17 - need the clipboard content.
I cannot just rely on key detection, because I need the clipboard content which is only available through a paste event (there is no clean other way to access it). In this JSFiddle, I get the event and display the text (works on Chrome only)
http://jsfiddle.net/7N6Xq/412/
My final goal is to get an image from the clipboard and directly send it to the server.