From 00833eeafd6e0f71390504ac10ddf86bbaceb39f Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sun, 15 Sep 2013 14:03:27 +1000 Subject: js/ajax.js: post with ajax --- inc/display.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'inc/display.php') diff --git a/inc/display.php b/inc/display.php index e2646c60..7cd69134 100644 --- a/inc/display.php +++ b/inc/display.php @@ -74,6 +74,14 @@ function error($message, $priority = true, $debug_stuff = false) { $debug_stuff = array_combine(array('SQLSTATE', 'Error code', 'Error message'), $db_error); } + // Is there a reason to disable this? + if (isset($_POST['json_response'])) { + header('Content-Type: text/json; charset=utf-8'); + die(json_encode(array( + 'error' => $message + ))); + } + die(Element('page.html', array( 'config' => $config, 'title' => _('Error'), -- cgit v1.3