JavaScript conflicts - widgets don’t work

Tabs, rating, Google maps don’t work. What to do?

10.0/10 rating (1 votes)

If your tabs, rating or other widgets don’t work, it’s very likely that there is a JavaScript error. You can see this error by using a debugger of your browser (by pressing F12) on the errors tab or in the console.

Console in a browser

Often an error is caused by incompatibility of different extensions. The main problem of incompatibility is when some other extension (or even a template) uses its own jQuery file. That’s why it is recommended to use jQuery from JBZoo (ZOO).

Almost always we use the latest jQuery library. It has very good backward compatibility. You can see a typical error on this screenshot.

Typical jQuery errors in a console

As you can see, jQuery was unable to find tooltip and fancybox plugins. Any other plugins can cause this as well. The thing is that after these plugins were declared (by including JS-file), next include of jQuery will cancel their declarations because a library is initialized the second time.

In order to find unnecessary includes, press Ctrl+U and a page with the code will appear. In the following example you can see that a file #2 is preferred and should be included before others (it will be done automatically). Other includes are unnecessary and most likely come from third-party extensions or templates.

Unnecessary includes

If you don’t have basic JavaScript knowledge, try to use special Joomla plugins. For example, jQuery Easy or JB Library Plugin. You can also find some useful information on the YOOtheme website (developers of templates and extensions for Joomla).

There are cases when the reason of problems is a built-in “accelerator” that trims spaces/line breaks/comments from HTML, concatenates CSS and JavaScript files. Not all optimizers are good and able to correctly compress a code without mistakes. We recommend you to disable them during development phase and enable them only when website is finished.

Still gotta questions, who can help me?

Visit our special JBZoo tech support forum which is specifically meant for JBZoo so the priority of the response and its promptness are much better there than in any other place. With inactive account with a “Plus” sign in a tariff plan you can ask for support in one of these sections or use any of our contacts.