URGENT: Need help resolving what appears to be a jQuery/MooTools conflict

Hi:

I am attempting to implement a jQuery plugin called Textify which I purchased on CodeCanyon.

Textify requires jQuery, and I am implementing this plugin in a Joomla 2.5 environment using the Vertex framework from Shape5.

After integrating the plugin into the site, I am getting 5 “‘undefined’ is not a function” errors.

The dev site is located at http://sosdivorce.ergonomiq.net

I would sincerely appreciate any help, and would be happy to provide someone who could help me with superadmin access to the backend of the Joomla install and/or ssh access to the server.

This is rather urgent, so any help would be appreciated.

Thanks.

After including jQuery, place the following:

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

After which you have to change a small piece in your code:

Change

<script type="text/javascript">  
    $(document).ready(function (){    
      //Usage  
      $(".longText").textify();     
    });   
</script>

into

<script type="text/javascript">  
    jQuery(document).ready(function (){    
      //Usage  
      jQuery(".longText").textify();     
    });   
</script>

That should do the trick, normally :slight_smile:

The noConflict function does the following: You can’t use the jQuery’s $-sign, instead you have to write “jQuery” - by doing so, jQuery doesn’t overwrite any functions of other libraries.

If you were a girl and I wasn’t married and you were next to me, I’d kiss you!

Thank you.

a beer will do :wink:

you’re welcome :slight_smile:

Yes you can continue to use $ by providing it as a function parameter, so that it can be used inside of the jQuery wrapper that you initially set up.

For example:


jQuery(document).ready(function ($) {
      //Usage  
      $(".longText").textify();     
});

Or using a technique that’s more preferred these days to achieve the same resu:


jQuery(function ($) {
      //Usage  
      $(".longText").textify();     
});