Page 2 of 2

Re: JQuery & Mootools

Posted: Fri Apr 02, 2010 2:27 am
by gmcgilli
Zyloch wrote:All decent jQuery plugins I've seen have been careful to use jQuery() instead of $(), or assign $ to jQuery in local scope. In doing so, it is no longer an issue that jQuery.noConflict() is called last in the <head> section. Is this not the case with Thickbox?

Also, when loading jQuery with JHTML::script('jquery.js', $path, false), I use the following code:

$doc =& JFactory::getDocument();
$script = 'if($===jQuery){jQuery.noConflict();}';
$doc->addScriptDeclaration($script);

This ensures that even if MooTools is loaded after jQuery and before the call to jQuery.noConflict(), that nothing bad happens.


This was just what I was looking for. Thanks for posting!

Cheers,
Garry

Re: JQuery & Mootools

Posted: Fri May 07, 2010 2:46 pm
by terrywmu
Zyloch wrote:All decent jQuery plugins I've seen have been careful to use jQuery() instead of $(), or assign $ to jQuery in local scope. In doing so, it is no longer an issue that jQuery.noConflict() is called last in the <head> section. Is this not the case with Thickbox?

Also, when loading jQuery with JHTML::script('jquery.js', $path, false), I use the following code:

$doc =& JFactory::getDocument();
$script = 'if($===jQuery){jQuery.noConflict();}';
$doc->addScriptDeclaration($script);

This ensures that even if MooTools is loaded after jQuery and before the call to jQuery.noConflict(), that nothing bad happens.
Majorly tech-challenged here... Where would I put that? In the jquery.js file?

Thanks,

Terry

Re: JQuery & Mootools

Posted: Fri May 07, 2010 7:55 pm
by Jimerz
terrywmu wrote:
Zyloch wrote:All decent jQuery plugins I've seen have been careful to use jQuery() instead of $(), or assign $ to jQuery in local scope. In doing so, it is no longer an issue that jQuery.noConflict() is called last in the <head> section. Is this not the case with Thickbox?

Also, when loading jQuery with JHTML::script('jquery.js', $path, false), I use the following code:

$doc =& JFactory::getDocument();
$script = 'if($===jQuery){jQuery.noConflict();}';
$doc->addScriptDeclaration($script);

This ensures that even if MooTools is loaded after jQuery and before the call to jQuery.noConflict(), that nothing bad happens.
Majorly tech-challenged here... Where would I put that? In the jquery.js file?

Thanks,

Terry
Replace all the '$' with 'jQuery' (note the capital Q) in the javascript calling the jquery.js; not *in* jquery.js

Re: JQuery & Mootools

Posted: Fri May 07, 2010 8:04 pm
by terrywmu
Awesome -- thank you so much, Jimerz!

Terry

Re: JQuery & Mootools

Posted: Mon May 10, 2010 8:22 am
by ah010223
Thanks for this thread as I have been benefited. Actually I used the code of noConflict but plugin is also workable.

Re: JQuery & Mootools

Posted: Sun Jun 13, 2010 8:23 pm
by gyoza
SC Jquery.

How do I call sc jquery?? Can somebody provide an example .php? Thanks!

Re: JQuery & Mootools

Posted: Fri Aug 27, 2010 12:02 pm
by Kilian89
i found a solution how to use jquery into front-end template

1. Download http://extensions.joomla.org/extensions ... ripts/7230
2. Install and activate it in admin panel
3. Now U can include js file in your index.php like:

Code: Select all

<script src="<?php echo $this->baseurl ?>/templates/ur_template/js/file.js" type="text/javascript"></script>
4.In js file just use:

Code: Select all

jQuery(function($){
 //put here all your jquery code ;)
});
It`s work fine.

for example i use it here in menu boxes, just hover on box ;)

Code: Select all

http://probud.softgraf.pl/

Re: JQuery & Mootools

Posted: Tue Nov 23, 2010 8:52 pm
by markstrange
I used Kilians method with success.

Re: JQuery & Mootools

Posted: Fri Nov 26, 2010 2:04 am
by h2mao
Kilian89 wrote:i found a solution how to use jquery into front-end template

1. Download http://extensions.joomla.org/extensions ... ripts/7230
2. Install and activate it in admin panel
3. Now U can include js file in your index.php like:

Code: Select all

<script src="<?php echo $this->baseurl ?>/templates/ur_template/js/file.js" type="text/javascript"></script>
4.In js file just use:

Code: Select all

jQuery(function($){
 //put here all your jquery code ;)
});
It`s work fine.

for example i use it here in menu boxes, just hover on box ;)

Code: Select all

http://probud.softgraf.pl/

Champion, it works for me.

:D :D

Re: JQuery & Mootools

Posted: Sat Dec 11, 2010 4:37 am
by Esteban Soler
If you are referring to my plugin jsloader, there is some info about how to use it in the download page. you need to install the plugin in joomla admin and use it at will on your code.

Re: JQuery & Mootools

Posted: Thu Dec 30, 2010 10:53 am
by sazz

Code: Select all

jQuery(function($){
//put here all your jquery code ;)
});
Where to find that
all your jquery code

Re: JQuery & Mootools

Posted: Fri May 27, 2011 8:31 am
by Pete_Evans
Yes! Thank you so much. Have just enabled the method Kilian89 describes and everything now works fine.

Re: JQuery & Mootools

Posted: Mon Nov 07, 2011 1:28 pm
by polpaulin
JQuery will be the best solution like Drupal and wordpress

Re: JQuery & Mootools

Posted: Tue Feb 12, 2013 7:31 pm
by jdran
FR6 wrote:You can find a great PDF (it is a free chapter of a book) explaining how to use jQuery and Mootools at same time without conflict at

http://www.packtpub.com/files/learning- ... ffects.pdf

via

http://www.designvsdevelop.com/using-mo ... in-joomla/

It works very well for me.
first url is dead, I found it googling the name of the chapter:
download link