Created
January 30, 2014 17:07
-
-
Save magnum/8713517 to your computer and use it in GitHub Desktop.
managing rails ajax calls' timeout /error
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
$.rails.ajax = (options) -> | |
if not options.timeout | |
options.timeout = 10000 # 10 secs of timeout | |
options.error = (jqXHR, textStatus) -> | |
alert("Si è verificato un errore: \n"+textStatus.toUpperCase()) | |
community_helper.loading_hide() | |
return $.ajax(options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment