使用jQuery有没有办法捕获用户的粘贴事件,然后确定用户是否粘贴了代码片段?(ruby、php、html、css、js等)?
谢谢
发布于 2012-01-16 23:14:01
将paste
绑定到您的输入。
类似于:
$("selector").bind('paste', function(e) {
//Get pasted text, need a small timeout
var element = $(this);
setTimeout(function() {
var text = $(element).val();
alert(text);
}, 100);
});
https://stackoverflow.com/questions/8887565
复制