==== JavaScript ==== DokuWiki makes uses of [[wp>JavaScript]] to enhance the user experience. Like for [[doku>css|stylesheets]] all JavaScript files are delivered through a single dispatcher to minimize HTTP requests, for caching and [[doku>config:compress|compression]]. This page gives you an overview how JavaScript is loaded from DokuWiki core, [[doku>plugins]] and [[doku>templates]]. It also gives some info about event handling and coding style when writing JavaScript for use in DokuWiki. === JavaScript loading === All JavaScript is collected and delivered by [[xref>lib/exe/js.php]]. This file will concatenate all found files, whitespace compress (if [[doku>config:compress]] is enabled) and cache the result. It also instructs browsers to cache the file, so when you are developing new JavaScript, be sure to refresh your browser cache (hitting Shift-F5, Shift+CTRL+R or similar) whenever your script was updated. DokuWiki will load JavaScript from the following places: * autogenerated JavaScript (language strings, config settings, [[doku>toolbar]]) * lib/scripts/*.js * lib/plugins/*/script.js * lib/tpl//script.js * conf/userscript.js As you can see you can provide JavaScript with your [[doku>templates]] and [[doku>plugins]] (through a ''script.js'' file) and can define your own scripts in ''conf/userscript.js''. === See also === * [[doku>devel:javascript]]