How to solve jQuery and MooTools Conflict
Jquery and mootools both are popular JavaScript libraries and Joomla developers often use both. when you want to use both in joomla module or joomla component then remember the point is that mootools library must be loaded before jquery. So far not a big deal, but without forcing mootools to be loaded first there is a chance that your jquery code will be conflict the code.
To prevent more issues, just put this line at the top of your component entry point file (component.php):
In Joomla 2.5
JHTML::_('behavior.mootools'); // this code make sure that mootools loads first
your code here
In Joomla 3 and later
JHtml::_('behavior.framework');// this code make sure that mootools loads first
your code here
Now in your jQuery plugin, return the jquery handler.
var jQ = jQuery.noConflict(); // now use jQ instead of $ symbol
your code here
or just the below code
jQuery.noConflict(); // this will keep using the $ symbol
your code here
Now everything is set, you can use both library in your code.
If you have the same issue while using this following function:
$('adminForm_'+pf).addEvent('submit', function(e) {
Just modify the code to the following:
var $=document.id;
$('adminForm_'+pf).addEvent('submit', function(e) {