This plugin provides the ability to use traditional copy-and-paste javascript code snippets in your wiki pages.
This plugin does one thing: it inserts the contents of the javascript into the BODY of a wiki page (inbetween the < BODY > and < /BODY > tags) at the position where the .js file is called. So, this works for javascripts that only need code to be put in the BODY of a web page.
--> For javascripts where code also needs to be inserted into the HEAD (inbetween the < HEAD > and < /HEAD > tags), an update to this plugin is in the works
Instructions for Use
Copy and paste your code snippet into a new text document, and remove the , and tags.
Save the document with .js at the end in place of .txt (or you can rename it after saving).
Put this new .js file in the root folder of your tiki installation.
Use the following syntax (replacing js-file_name.js with the name of the new .js file) in the wiki page where you want the javascript to run: {JSFILE(file=js-file_name.js)}{JSFILE}
Download
Installation
Version 2 of JSFILE includes a head parameter {JSFILE(head=js-file_name.js,file=js-file_name.js)}{JSFILE} which allows JavaScript to be added into the HEAD section on the WIKI page.
This version requires 1 line of code to be added in your header.tpl:
Find this near the top of your header.tpl, the key is the /title: