Warning There will be no conflict resolution until jQuery is enabled.
Enabling jQuery will trigger several actions. By default (before enabling/modifying advanced options), the plugin will:
- look for library duplicates (jQuery, Migrate, jQuery UI or jQuery Mobile) in <script> tags,
- look for stylesheet duplicates (for jQuery UI and jQuery Mobile) in <link> tags,
- look for
no conflict
scripts and declarations, - delete those scripts, stylesheets and declarations,
- replace the deleted libraries with the ones that you have selected,
- add a single
no conflict
code script, - put all scripts in the correct order, alongside all other scripts of the treated page.
Add/Fix jQuery |
|
Note if jQuery UI or jQuery Mobile are not already located in the code source of your page, then you probably do not need it.
jQuery
(Learn about jQuery)Version |
Profiles slimversions are available. |
Sub-version | When using versions 1.9 and over, the Google CDN asks us to specify which release of that milestone is actually requested. Prior to v1.9, the latest release of each milestone is used by default. But one can still specify a sub-version. Example |
Local path | The path to the local file when using the local version option.
Example |
Migrate version | Use in conjunction with jQuery libraries v1.9 and over. It garanties older scripts created for jQuery remain compatible with the latest versions of the library.
|
Sub-version | Starting version 3.0, you need to specify the Migrate sub-version (x)
Example |
Migrate local path | The local path to the jQuery Migrate plugin
Example |
jQuery UI
(Learn about jQuery User Interface)Version |
|
Sub-version | When using versions 1.9 and over, the Google CDN asks us to specify which release of that milestone is actually requested. Prior to v1.9, the latest release of each milestone is used by default. But one can still specify a sub-version. Example |
Custom/Local path | The path to the local or custom file when using the custom/local option. The jQuery UI file can be the full-blown UI library or a custom one created at the jQuery UI website. Example |
Theme | Set the UI theme (or skin) that will be used in conjunction with the jQuery UI library. Themes are not always required.
Note The Joomla! framework does not package a theme for jQuery UI (the library has been customized and does not require skins). Therefore, do not load a theme when using the jQuery UI library packaged with Joomla. Warning Since jQuery UI v1.10.2, the base theme is not available anymore. Use another skin or you will end up with errors on the page. It has been re-introduced in jQuery UI v1.12.0. |
Custom/local theme path | The path to the custom or local CSS file. Get or customize skins at the UI ThemeRoller website. Note Images are usually associated with a skin. Wherever the path of your file is, add a images/ folder containing those images.
Example |
jQuery Mobile
(Learn about jQuery Mobile)Version |
|
Local javascript path | When using the localoption, set the path to the local javascript (.js) file Example |
Local stylesheet path | When using the localoption, set the path to the local stylesheet (.css) file Example |
Theme | Set the mobile theme that will be used in conjunction with jQuery Mobile.
|
Custom theme path(s) | The path to the custom skin stylesheet(s). Customize skins at the Mobile ThemeRoller website.
Example |
Additional modifications (dependent)
The following settings work in conjunction with the Add/Fix jQuery value. They will have no effect if the Add/Fix jQuery value is set to No.
removed in J! 4 Replace when unique |
Replaces the jQuery/jQuery UI libraries and/or jQuery UI CSS with the plugin’s choices even when there is only one instance of those present on the page. New v4+ Profiles the same rule applies to jQuery Mobile |
removed in J! 4 Add when missing |
Adds the jQuery library to pages that do not have jQuery in them |
Ignore scripts | Makes sure the scripts listed remain on the page and are not stripped out by the plugin (some file names are built in such a way they can be mistaken for a jQuery library). One script per line. Note Joomla 3 The script file media/jui/js/chosen.jquery.min.js is added by default because it is commonly used.
Example |
Strip no conflictcode |
Removes all no conflictscripts and declarations by default. Will get rid, for instance, of jQuery.noConflict() , $.noconflict() , jQuery.noConflict(false) , $.noConflict(true) , var j = $.noConflict(true) Warning When a variable declaration is removed, it may be necessary to re-inject it in the code (go to the scripts tab). For instance, var j = $.noConflict(true) should be re-introduced as var j = jQuery.noConflict(true) .New v4+ You now have the option to skip the removal of the noConflict declarations that have a variable attached to them. When ignored, it still replaces $ with jQuery Warning The regular expression that is used to remove code like var j = $.noConflict(true) can timeout on large pages, especially when images are encrypted and embedded in the source code.Joomla 4 When removing the noConflict script declarations, it will keep variable-assigned declarations |
Add no conflictcode |
Joomla 4 Only adds the script alongside jQuery |
Fix document ready | Replaces all occurrences of $(document).ready(function() or $(document).ready(function($) with jQuery(document).ready(function($) .Using jQuery in the statement is required when using no conflict |
New Profiles Defer jQuery |
Add the defer attribute to all jQuery-related scripts (jQuery, Migrate, jQuery UI ...) at once |
Additional modifications (independent)
The following settings are independent from the Add/Fix jQuery option.
Caption | |
---|---|
removed in J! 4 Disable Captions |
Gets rid of JCaption. Profiles v4+ The option Yes, by overload overloads the core Joomla calls for captions by returning nothing whenever captions are called site wide. It prevents lookups by regular expressions, making the process faster. Note Since Joomla! 3.2, the caption script is a jQuery script. |
Chosen | |
Profiles Disable Chosen |
Gets rid of the Chosen plugin. The option Yes, by overload replaces the core Joomla call to Chosen with nothing whenever Chosen is called (the scripts and styles will be removed site-wide). It's an alternative to using regular expressions, making the process faster. |
Important information
Using sub-versions is useful for caching the library files for a year and therefore optimizes website loading times. Find more information at the BucketSoft blog.
The plugin will sometimes remove the wrong scripts when looking for jQuery libraries. For instance:
…searchtools.jquery.min.js
will be removed, wrongly identified as a jQuery library,…jquery.searchtools.min.js
will not be removed, rightly assuming this is a jQuery plugin.
When a library has been wrongly deleted (easily identified if you are using the reporting tool or comparing the source code before and after enabling the plugin), use the Ignore scripts
option to force the plugin to ignore the script in its search for jQuery libraries.