var activeRequests = 0; $(function() { $('#change').text('I changed it'); $('#drag').draggable(); $('#drop').droppable({ drop: function(event, ui) { ui.draggable.remove(); $(this).html('Dropped!'); } }); $('#clickable').click(function() { var link = $(this); setTimeout(function() { $(link).after('Has been clicked'); $(link).after(''); $(link).after(''); $('#change').remove(); }, 500); return false; }); $('#slow-click').click(function() { var link = $(this); setTimeout(function() { $(link).after('Slow link clicked'); }, 4000); return false; }); $('#waiter').change(function() { activeRequests = 1; setTimeout(function() { activeRequests = 0; }, 500); }); $('#with_focus_event').focus(function() { $('body').append('
Focus Event triggered
'); }); $('#with_change_event').change(function() { $('body').append($('').text(this.value)); }); $('#checkbox_with_event').click(function() { $('body').append('Checkbox event triggered
'); }); $('#fire_ajax_request').click(function() { $.ajax({url: "/slow_response", context: document.body, success: function() { $('body').append('Ajax request done
'); }}); }); $('#reload-link').click(function() { setTimeout(function() { $('#reload-me').replaceWith(''); }, 250) }); $('#reload-list').click(function() { setTimeout(function() { $('#the-list').html('