Show a loading indicator while a jQuery AJAX call runs

// ajaxStart only fires when no other request is already in flight, so
// overlapping calls do not make the indicator flicker.
$('#spinner').on('ajaxStart', function () {
    $(this).show();
}).on('ajaxStop', function () {
    $(this).hide();
});