[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 58/107: javascript Add new function json_resp
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 58/107: javascript Add new function json_response |
Date: |
Mon, 26 Aug 2019 10:31:58 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 875071214e66b726055b2679b3928898ea582e0b
Author: Dany De Bontridder <address@hidden>
Date: Tue Jul 30 21:52:49 2019 +0200
javascript Add new function json_response
---
include/lib/function_javascript.php | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/lib/function_javascript.php
b/include/lib/function_javascript.php
index 0db0317..12dbbde 100644
--- a/include/lib/function_javascript.php
+++ b/include/lib/function_javascript.php
@@ -2784,4 +2784,16 @@ function load_all_script()
}
+/**
+ * Send header and json object
+ * @param array $p_answer this array will be converted to json object
+ * @see json_encode
+ */
+function json_response($p_answer)
+{
+ header("Content-type: text/json; charset: utf8", true);
+ echo json_encode($p_answer,
+ JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK);
+}
+
?>
- [Noalyss-commit] [noalyss] 61/107: Documentation, (continued)
- [Noalyss-commit] [noalyss] 61/107: Documentation, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 62/107: #1316: Notes tableau de bord - pas de limite ou choix., Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 69/107: Fix test, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 50/107: Documentation : automatic format breaks doxygen tag, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 43/107: fixup! Code cleaning : split database into database (for noalyss) and databasecore , with the functions, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 65/107: Code cleaning : remove obsolete, and direct access to, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 74/107: New : manage_table_sql has new function (input_custom and display_row_custom) for handling special data, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 73/107: Cosmetic & bug fix for SELECT_BOX, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 28/107: Debug : add function tracedebug, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 32/107: Cosmetic : font new symbol Cosmetic : CSS padding for div.menu2 a.mtitle, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 58/107: javascript Add new function json_response,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 52/107: Adapt Unit Test, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 76/107: fixup! Improve message progress bar + translation, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 78/107: Purpose is to contain all the prepared query called from different locations, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 83/107: Task#1734 New : Add PRINTTVA to have a summary of VAT by ledger, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 93/107: Documentation, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 92/107: Code : remove direct use of $_GET, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 39/107: Code cleaning : split database into database (for noalyss) and databasecore , with the functions, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 98/107: New :: function Icon_Action::tips for short comment New : Icon_Action::unlock, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 84/107: Task #1734 Upgrade patch for PRINTTVA, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 46/107: Code Cleaning split PDF into PDF_Core and PDF, Dany De Bontridder, 2019/08/26