Created
October 11, 2013 18:16
-
-
Save rpq/6939503 to your computer and use it in GitHub Desktop.
ajax spinner and django header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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