Add some nice defaults for jQuery ajax

This commit is contained in:
Eric Davis 2011-12-28 16:29:01 -08:00
parent 08454ab7fa
commit aafec2c50f
1 changed files with 9 additions and 0 deletions

View File

@ -465,6 +465,15 @@ jQuery.viewportHeight = function() {
document.body.clientHeight;
};
// Automatically use format.js for jQuery Ajax
jQuery.ajaxSetup({
'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
})
// Show/hide the ajax indicators
jQuery("#ajax-indicator").ajaxStart(function(){ jQuery(this).show().css('z-index', '9999'); });
jQuery("#ajax-indicator").ajaxStop(function(){ jQuery(this).hide(); });
/* TODO: integrate with existing code and/or refactor */
jQuery(document).ready(function($) {