Skip to content

Instantly share code, notes, and snippets.

@rpq
Created October 11, 2013 18:16
Show Gist options
  • Save rpq/6939503 to your computer and use it in GitHub Desktop.
Save rpq/6939503 to your computer and use it in GitHub Desktop.
ajax spinner and django header
3 /** setup spinner on ajax calls **/
4 $.ajaxSetup({
5 headers: { "HTTP_X_REQUESTED_WITH": "XMLHttpRequest" },
6 cache: false,
7 error: function() {
8 alert('There was an error reaching the server!');
9 },
10 timeout: 10000,
11 beforeSend: function() {
12 $('#loading-status').show();
13 },
14 complete: function() {
15 $('#loading-status').fadeOut('slow');
16 }
17 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment