Skip to content
Snippets Groups Projects
Commit aafec2c5 authored by Eric Davis's avatar Eric Davis
Browse files

Add some nice defaults for jQuery ajax

parent 08454ab7
No related merge requests found
......@@ -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($) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment