Created
January 24, 2012 20:28
-
-
Save glynrob/1672373 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$.ajax( | |
{ | |
type: "POST", | |
url: "/ajax/autosave", | |
data: data, | |
cache: false, | |
success: function(message) | |
{ | |
if (message == '1'){ // show success saved | |
t = setTimeout("autosave()", 60000); // set timer for next autosave | |
} else if (message == '2'){ // show error | |
var answer = confirm("Your session has timed out. Please login again to continue") | |
if (answer){ | |
window.location = "/signin"; | |
} | |
} else { // an error has occured | |
t = setTimeout("autosave()", 120000); // set the time for a larger amount | |
} | |
//alert(message); // for testing purposes | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment