Commit 8c58138e authored by Mat's avatar Mat

postAJAX, gestion des erreurs, sépare le test readystate et status 200

parent 9a89a172
......@@ -166,17 +166,23 @@
// Annule l'événement, mais préserve la fonction callback
e.preventDefault();
if (this.readyState === 4 && this.status === 200) {
postAJAX(submitURL, function()
{
if (this.readyState === 4)
{
if (this.status === 200)
{
reloadTableOwner();
form.parentNode.classList.add('hidden');
} else if (this.status === 400) {
console.log('BAD REQUEST. DISPLAY ERRORS');
}
}
}, form);
});
</script>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment