Skip to content
You are here: Home arrow News & Info arrow Javascript Conflicts
Javascript Conflicts
Written by Sigrid Suski   

Triggered by new concepts such as Web 2.0 and Ajax a lot of Joomla! software developer use JavaScript for their components, modules and mambots.
Because of these requirements a variety of libraries has been created to make the development of such applications easier. Besides Ajax functions most of these libraries provide a basis for object-oriented programming, an abstraction layer for the comfortable working with the DOM and graphic effects such as animations.
These are among others the well-known JavaScript libraries like jQuery, MooTools and Prototype. Especially with graphical effects deal Moo.fx and Script.aculo.us.

Unfortunately these different JavaScript libraries don't work always together. If one developer would develop all add-ons used on a website, he would use one or two JavaScript libraries which do work together.

But what is the reality?

You build up a web site using Joomla!, developed by the Joomla! developer team. You use SOBI2 developed by Sigsiu.NET and you use a lot of other third party components, modules and mambots - and don't forget - the Joomla! template you use, developed by a template club (Joomlart, Rockettheme, a.s.o.).

So the probability to have different JavaScript libraries on your website which don't work together is high.
The more third party add-ons you have installed in your Joomla! the higher is the possibility to get incompatibilities. Therefore remove all modules and mambots which you do not use. This is also recommended for security reasons.

What is the result?

Some functions don't work. These can be e.g. the SOBI2 search function, the Wysiwyg-Editor or SigsiuTree or any other function.
Also a Javascript error will be generated. Depending on the browser you use this looks different. Firefox has an error console, where all the Javascript errors are noted. The site will be shown but some functions don't work. IE (M$ Internet Explorer) doesn't have such an error window. IE pops up an error message (mostly the "Operation aborted" message) and stops showing the page.
If a Javascript error occurs in the script of a third party add-on, it is the nature of Javascript, that other used scripts also won't work.

If this happens on your site, please note: this is NOT a bug in SOBI2, nor is it a bug in another component, module or mambot. It is just an incompatibility between different used libraries.

What can you do?

First, you have to find out which library (module, mambot) does not work with the libraries used by SOBI2.
Then you have to decide if you want to use this module, mambot or SOBI2.

How can you find the incompatible library?

Javascript libraries are either located in files with the extension .js or directly between <script> and </script>.

Certainly there are a lot of possibilities how the culprit can be found. You can remove the mambots and modules (often only unpublish doesn't help). Because I am most often don't have direct access to the CMS of the web site I prefer this method:

  • Click on the page where the error occurs.
  • Now let your browser show the generated source code (Ctrl-U for Firefox).
  • Copy this code in your clipboard and paste it into an editor. Preferably use a HTML editor for it like Dreamweaver or Komposer (formerly NVU).
  • Now look for Javascript files, like the following: <script language="javascript" type="text/javascript" src="http://www.site.com/modules/mod_supergood/myscript.js"></script>.
  • Delete the first line with this Javascript code, save the file and execute it in your browser.
  • Check out if the error still persists. If not, you have found the culprit. If the error is still there, delete the next line and so on.
  • Also delete the code between <script> and </script> which inserts Javascript code directly.

During this process the shown page won't look as is should because of the missing libraries, but don't worry about it.

Because each site is different, there is no general solution for this available.

See also Diagnosing JavaScript problems, written by aboututila.

Found problems with:
  • gAjax Scroller of Dynamic Drive
  • If the integrated TinyMCE in the Add entry form conflicts with other Javascripts, you can solve the conflict by switching off the Wysiwyg editor in the custom fields manager.
  • Also the mootools library used by Rockettheme templates can conflict with SOBI2 mootools.
  • IE PNG fix scripts often conflicts.
  • shSmoothSlideshow

We try to keep this list actual.

 
Ads/Anzeige
Become a SobiPro Bronze Club Member