ajax prevent multiple clicks

$('.pagination li a').click(function(e) { var me = $(this); e.preventDefault(); if ( me.data('requestRunning') ) { return; } me.data('requestRunning', true); $.ajax({ url: this.href, type: 'get', dataType: 'html', success: function(data) { }, complete: function() { me.data('requestRunning', false); } }); });

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.