Tips & Tutorials

Including jQuery and jQuery Plugins

clearFusionCMS can automatically include jQuery depending on the elements being placed on the page e.g. a form with validation will include jQuery as it is used for validating the form.

Therefore if you need to add additional JavaScript to your page while ensuring that jQuery is loaded once and only once you need to use the javascript snippet, http://docs.clearfusioncms.com/guides/snippets/core-snippets/javascript/ with the jQuery parameter set to 1.

The following when added to the <head> section of the page includes jQuery if not already present and the js file example.js.

[[javascript &jQuery=`1` &src=`example.js`]]