Skip to content
Snippets Groups Projects
Commit 43ee3fd0 authored by Anton Sarukhanov's avatar Anton Sarukhanov
Browse files

Forgot how to jQuery

parent 8956571d
No related branches found
No related tags found
No related merge requests found
......@@ -24,20 +24,19 @@
type: 'POST',
url: $(selector).attr("action"),
data: $(selector).serialize(),
success: function(response) {
$(selector).html(response);
},
statusCode: {
429: function() {
if (jqXHR.getResponseHeader("Retry-After")) {
alert("Too many requests from your network. Please try again in "
+ jqXHR.getResponseHeader("Retry-After") + " seconds.");
} else {
alert("Too many requests from your network. Please try again later.");
}
})
.done(function(jqXHR, response) {
$(selector).html(response)
})
.fail(function(jqXHR, response) {
if (jqXHR.statusCode() == 429) {
if (jqXHR.getResponseHeader("Retry-After")) {
alert("Too many requests from your network. Please try again in "
+ jqXHR.getResponseHeader("Retry-After") + " seconds.");
} else {
alert("Too many requests from your network. Please try again later.");
}
},
error: function(jqXHR, error_type, e) {
} else {
alert("Sorry, an error occurred. Please try again, or email me.");
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment