DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:javascript

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
devel:javascript [2023-02-20 00:54] – old revision restored (2022-12-20 20:37) Klap-indevel:javascript [2023-05-17 10:16] (current) Chris75
Line 5: Line 5:
 This page gives you an overview how JavaScript is loaded from DokuWiki core, [[:plugins]] and [[:templates]]. It also gives some info about event handling and coding style when writing JavaScript for use in DokuWiki. This page gives you an overview how JavaScript is loaded from DokuWiki core, [[:plugins]] and [[:templates]]. It also gives some info about event handling and coding style when writing JavaScript for use in DokuWiki.
  
-===== JavaScript loading =====+===== JavaScript Loading =====
  
-All JavaScript is collected and delivered by [[xref>lib/exe/js.php]]. This file will concatenate all found fileswhitespace compress (if +All JavaScript code is collected from all found files and concatenated as one block of code. It is then whitespace compressed (if [[config:compress]] is enabled) and delivered as one file. As a live example you can view the JavaScript file that is in effect on this website [[this>lib/exe/js.php|lib/exe/js.php]]. This file will be cached in the DokuWiki cache at ''/dokuwiki/data/cache'' and DokuWiki also instructs browsers to cache this file. So when you are developing new JavaScript, make sure to refresh those caches (hitting Shift-F5, Shift+CTRL+R or similar)whenever your script was updated.
-[[config:compress]] is enabled) and cache the resultIt 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: DokuWiki will load JavaScript from the following places:
Line 18: Line 17:
   * conf/userscript.js   * conf/userscript.js
  
-As you can see you can provide JavaScript with your [[:templates]] and [[:plugins]] (through a ''script.js'' file) and can define your own scripts in ''conf/userscript.js'' (just create this file if it does not exist yet).+As you can see you can provide JavaScript with your [[:templates]] and [[:plugins]] (through a ''script.js'' file) and can define your own scripts in ''conf/userscript.js'' (just create this file if it does not yet exist).
  
 ==== Deferred Loading ==== ==== Deferred Loading ====
devel/javascript.1676850852.txt.gz · Last modified: 2023-02-20 00:54 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki