mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
Handle XHR errors better
This commit is contained in:
parent
4083c92dbe
commit
d3cc27ff5c
12
js/ajax.js
12
js/ajax.js
@ -115,17 +115,7 @@ $(window).ready(function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(xhr, status, er) {
|
error: function(xhr, status, er) {
|
||||||
// An error occured
|
alert(_('The server returned an error or truncated response -- your post was probably still submitted. If it wasn\'t, 8chan.co might be experiencing issues right now -- please try your post again later.'));
|
||||||
do_not_ajax = true;
|
|
||||||
$(form).find('input[type="submit"]').each(function() {
|
|
||||||
var $replacement = $('<input type="hidden">');
|
|
||||||
$replacement.attr('name', $(this).attr('name'));
|
|
||||||
$replacement.val(submit_txt);
|
|
||||||
$(this)
|
|
||||||
.after($replacement)
|
|
||||||
.replaceWith($('<input type="button">').val(submit_txt));
|
|
||||||
});
|
|
||||||
$(form).submit();
|
|
||||||
},
|
},
|
||||||
data: formData,
|
data: formData,
|
||||||
cache: false,
|
cache: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user