Most Common Javascript Conflicts
3rd party extensions required from various sources are often the source of the conflicts of Javascript library problems. This is probably the most common issue reported with scripts from our users. These issues are typically caused by other extensions that have been selected by webmasters.
Some of the most popular extensions are supported within our templates.
Joomla 2.5 will natively support any of the MooTools framework. However, developers of 3rd party extensions will opt to use jQuery framework tools that will require each of the jQuery libraries be loaded separately. Mootools is not included in Joomla 3.0, but jQuery conflicts are still met.
In order to circumvent any problems, it is best to use the same framework that is required from extensions. Script problems can be avoided by standardizing your framework, allowing for you to speed up your website and make data transfers more efficient. The source of javascript conflicts could be the result of conflicting frameworks being used on the same web page.
How to spot potential problems early
Inside the Google Chrome Inspector is “Console”, which can help spot any library conflicts. Firefox has the Firebug extension and Opera (version 12) has the Firefly extension that functions the same way. Right click anywhere on the page and click on “Inspect Element”. A new window will open at the bottom of the screen. Click on the last tab called “Console”. Run the debug feature and if there are any problems, you will be notified.
[ IMAGE ]
The above image is that of an example error message. However, be advised that there are times when no error message may be displayed even when there is a jQuery conflict.
The most common problems are:
- A Joomla extension has loaded a library that conflicts with an existing library
- Several versions of jQuery have already been loaded
- jQuery or Mootools have forcefully been disabled, but are required by the extensions being used
- No mootools-more.js library
- A broken or badly formed Javascript compression
- The source code has the wrong ordering of files
Using Mootools to solve jQuery conflicts
If the extensions used require both Mootools and jQuery frameworks, the best course of action is to set up a “noConflict” mode.
Removal of Additional jQuery Libraries
We know how to identify and realize when more than one jQuery library is a problem. The next task is to know how to solve the problem. This involves finding out what extra extensions are being loaded by the jQuery library. If you’re able to identify the library, there is still the option to use an extension to block it altogether.
The extension we’d recommend is called Joomlabamboo.
If you’re experiencing badly formed, broken, or Javascript compression
Several script problems have been found to be caused by Javascript compression utilities such as:
- JCH_Optimizer
- Jbetolo
- JS CSS Control
- RokBooster
Even though these “integrators” improve loading times, no guarantees are made in regards to the Javascript code being assimilated in a way that will be effective on your website. In this instance, you must have enough skills so that you’re able to set up your extensions and customizations yourself in order to achieve the best result.
Before making a request…
If you’re expericening some problems with a NorrTheme template, please eliminate any and all possibilities of your problems being caused by 3rd party extensions. In order to determine this, disable and retest your template to ensure that the 3rd party extensions are not the cause of your problems as we’re not responsible for problems incurred by 3rd part extensions. Should your problem be due to a 3rd party extension, please consult the creator of said extension.