SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation 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.

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2012
    Posts
    41
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    After including jQuery, place the following:
    Code JavaScript:
    <script type="text/javascript">
    	jQuery.noConflict();
    </script>

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

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

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

    That should do the trick, normally

    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.

  3. #3
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you were a girl and I wasn't married and you were next to me, I'd kiss you!

    Thank you.

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2012
    Posts
    41
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    a beer will do ;-)

    you're welcome :-)

  5. #5
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Denk View Post
    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.
    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:

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

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

    Code javascript:
    jQuery(function ($) {
          //Usage  
          $(".longText").textify();     
    });
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •