I\'m trying to write some code for Safari for handling the \'paste\' event, but it doesn\'t seem to work right. According to the WebKit DOM reference, oncut
, <
Don't know if it helps you, but I use a out-of-screen input to force safari accept paste on the page. It helped me so here it goes:
I'm doing:
script:
$(document).bind('paste', function(e) {
var data = e.originalEvent.clipboardData.getData('Text');
// here using data from clipboard
});
$(function(){
$('input.special').focus();
});
css:
input.special{
position:absolute;
top:-40px;
}
html: