[commits] [Wiki] changed: Doc/Dev/CheatSheet
Wiki Guest
wikiguest at horde.org
Sun Nov 3 09:18:14 UTC 2019
guest [95.90.223.65] Sun, 03 Nov 2019 09:18:14 +0000
Modified page: https://wiki.horde.org/Doc/Dev/CheatSheet
New Revision: 6
Change log: JS
@@ -24,8 +24,18 @@
$GLOBALS['registry']->applications[$app]['jsuri'];
Note: This is most likely not what you want. Use the template & js
loading mechanism instead
++ Servicing JavaScript
+
+++ Load a file from app or horde base
+
+$page_output->addScriptFile('jquery-ui/jquery-1.9.0.min.js', $app);
+
+++ Forward backend variable data to js
+
+$page_output->addInlineJsVars($data);
+This is useful for dynamic initialisation of Single Page
Applications. Solves chicken - egg: Provide dynamic data the js needs
to know but cannot (yet) get via ajax. Think of tokens or API Urls.
----
Back to the ((Project|Project List))
More information about the commits
mailing list