Translations of this page:

Using JQuery with MooTools

Claromentis uses MooTools javascript framework, as it is indicated on htmlheader.html

<script type="text/javascript" src="/intranet/js/mtools.js"></script>

Problem

You can’t mix JQuery and Mootols since both are using $ as the default call. Any claromentis application which are using javascript framework won’t work after all, for example Calendar or dynamic form field in InfoCapture.

Solution

According to JQuery documentation, to solve this problem is to run JQuery in NoConflic mode

Using jQuery with Other Libraries

  jQuery.noConflict();

Example implementation


<script type="text/javascript" src="/intranet/js/mtools.js"></script>
<script type="text/javascript" src="/intranet/js/cla_lib.js"></script>
<script type="text/javascript" src="/intranet/js/jquery.js"></script>
   <script>
     jQuery.noConflict();
     
     // Use jQuery via jQuery(...)
     jQuery(document).ready(function(){
       jQuery("div").hide();
     });
     
     // Use Prototype with $(...), etc.
     $('someid').hide();
   </script>


 
customisation/javascript/mootools_jquery.txt · Last modified: 07/06/2011 04:49 by admin
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki