Monday, January 12, 2009

I want to use MooTool, JQuery and other Javascript Libraries on the same page

Hi All, 

I love when this happens. Basically, I am wanting to use the MooTools library and the JQuery Library on the same page. The reason? Because I know JQuery, and am not adpet in MooTools, however there is MooTool library that I want to use....basically because it looks cool :)

The problem : If you use both libraries at the same time, you get conflicts with names, basically because both libraries use the $ symbol to work with their library.

The solution : couldn't be more simple (although it did take some time to work out). Place the following code in a script tag after you have loaded the jQuery library..

<script type="text/javascript">      jQuery.noConflict(); </script>   

No joke...that is it...

Hope this helps. 

 - Tim

No comments: