Possible Duplicate:
how to access the $(this) inside ajax success callback function
I have a code like this:
$('.each_button').click(function(){
$.ajax({ type: 'POST', url: process.php, data: data, success: function(data){
/////
}
})
});
How can I access the very $('.each_button') that triggered the event? I tried $(this) but it doesn’t work, probably because it’s inside of another function..
Thanks a lot in advance.
Everyone wants to use a variable for some reason. This isn’t necessary.
Or use
$.proxyif you prefer…One benefit to these approaches is that it lets you reuse the
successfunction…