I am using Joomla 1.5 and I must add the jQuery library within the after sales of joomla that helped me to add interaction in the style of my component sights.

I'd like jQuery to be included the Mind portion of certain pages from the administration not to mention without conflicting using the MooTools library that's already incorporated in Joomla.

Does anybody understands how to do this?

Would you like to be aware of really not so good news? Components designed for the admin side of Joomla frequently depend heavily on MooTools (as much as lately, a really ancient version of MooTools). Need to know what's promising? Should you place the jQuery script prior to the MooTools script, MooTools will override the $ variable, but you still have the jQuery variable. Doing the work the other way round, jQuery will own the $, plus some plug ins and templates will most likely yell to you.

So how you say? The simplest strategy is to take this road:


Use that file around line 129 where it states "Generate script file links". Before it runs the foreach over that $document->_scripts... array, place this:

if ($mainframe->isAdmin) {
    $strHtml .= $tab.'<script type="text/javascript" src="/media/system/js/jquery.js"></script>'.$lnEnd;

And merely replace that src with the road to your jquery script. Now inside your admin tool, you'll have the ability to reference the jQuery object using the global jQuery var such as this:


Which is why Joomla has a tendency to drive me insane. However..it had not been really designed for designers, it had been designed for customers.

An easy method, IMHO, would be to do your document ready function such as this:

var $jq = jQuery.noConflict();

  // your doc ready code...

Therefore the first factor it will is defined jQuery into noConflict mode which basically reassigns "$" to "$jq". So rather than calling jQuery such as this: $(x).y() you have to do this: $jq(x).y(). That's all good. Actually, you do not even need to do this, you should use "jQuery" too (i.e. jQuery(x).y() ). "$" is simply an alias.

Next, the doc ready construct above passes in '$' being an argument which again, alias for jQuery, and enables you to employ '$' inside the doc ready callback.

Hope this can help. I'd have published like a comment however i do not have sufficient points or anything to comment.