Я должен взять событие вставки текстовой области с помощью JQuery. Я попробовал следующий код, но он не работает...
$(document).ready(function()
{
$('#txtcomplaint').keyup(function()
{
TextCounter('txtcomplaint','counterComplaint', 1000 );
})
$('#txtcomplaint').onpaste(function()
{
alert()
//TextCounter('txtcomplaint','counterComplaint', 1000 );
})
});
Вы можете сделать что-то вроде этого
$("#txtcomplaint").bind('paste', function(e) {
var elem = $(this);
setTimeout(function() {
// gets the copied text after a specified time (100 milliseconds)
var text = elem.val();
}, 100);
});
$('#txtcomplaint').bind('paste', function(e){ alert('pasting!') })
Для получения дополнительной информации посмотрите здесь.