summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/display.php3
-rw-r--r--js/oekaki.js5
2 files changed, 5 insertions, 3 deletions
diff --git a/inc/display.php b/inc/display.php
index 0f1bc195..9009be9a 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -74,6 +74,9 @@ function error($message, $priority = true, $debug_stuff = false) {
if ($config['debug'] && isset($db_error)) {
$debug_stuff = array_combine(array('SQLSTATE', 'Error code', 'Error message'), $db_error);
}
+
+ // Return the bad request header, necessary for AJAX posts
+ http_response_code(400);
die(Element('page.html', array(
'config' => $config,
diff --git a/js/oekaki.js b/js/oekaki.js
index c610dd6b..2ff17fc7 100644
--- a/js/oekaki.js
+++ b/js/oekaki.js
@@ -254,10 +254,9 @@ $("form[name='post']").on("submit", function(e){
processData: false,
contentType: false,
success: function(data) {
- //location.reload();
- console.log(data);
+ location.reload();
},
- error: function(data) {alert("Something went wrong!"); console.log(data)}
+ error: function(jq, data) {alert($('h2',jq.responseText).text());}
});
}