We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2878
    • 81 Posts
    Now I’ve tried to use Ajax search and its disabled the jQuery navigation on that page?
    Tried the suggestions I’ve found on the forum but still the jQuery navigation will not work? This is all the references to jQuery in my Chucnk header. >

    <link href="assets/templates/bones/lavalamp_test.css" rel="stylesheet"  type="text/css" media="screen" />
        <script type="text/javascript" src="assets/templates/bones/jquery/jquery-1.2.3.min.js"></script>
        <script type="text/javascript" src="assets/templates/bones/jquery/jquery.easing.min.js"></script>
        <script type="text/javascript" src="assets/templates/bones/jquery/jquery.lavalamp.min.js"></script>
    
        <script type="text/javascript">
    $(function() {
              $("#1, #2, #3").lavaLamp({
                    fx: "backout",
                    speed: 700,
                    click: function(event, menuItem) {
                        return true;
                    }
                });
            });
    
        </script>


    Changed the $ to jquery inseted
    jQuery.noConflict();
    

    Just after
    <script type="text/javascript">

    Even tried changing the $’s in the linked to files and still not working?

    It’s been a long day.
    bauhaus9
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      A link could be useful wink

      Is AjaxSearch automatically including the jQuery library also, causing a conflict? What about QuickManager?

      I’m not sure what version of jQuery AjaxSearch needs nowadays, but perhaps try disabling automatic including of the libraries and instead manually including a later version to accommodate your navigation as well as AS. http://docs.jquery.com/Downloading_jQuery
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 15001
        • 697 Posts
        Hello,

        Some time ago, I also had issues with $ and jQuery. I’ll try to give below some explanation about them.

        In fact $ is a shortcut for the "jQuery" object which is defined by the jQuery library.
        But $ can be used by many scripts and also non-jQuery libraries like Mootools. From there the risk of conflicts. Even if your site doesn’t use Mootools, you can encounter problems. Personnaly, I didn’t use jQuery.noconflict()

        In general this works:
        (function (some_optional_argument) {
        Your jQuery script.
        }) (jQuery)


        Well, what does this strange syntax mean exactly?
        Inside the outermost "(...)" brackets, your define a function, like:
        function TheFunctionName(some_optional_argument) {
          What the function makes
        }


        How would you call a function that has no argument? This way:
        TheFunctionName()


        Now, in Javascript, you can define anonymous functions, that is functions that don’t have any name. That’s what we do:
        function (some_optional_argument) {}

        This function has no name, but receives an argument.

        The
        (jQuery)
        that ends my first example corresponds to
        TheFunctionName(jQuery)
        , but here, we simply evaluate the function that was defined just before. From here the importance of the () brackets around the function definition. Since this function does not have any name, the function call is simply
        (jQuery)


        As you can see, we pass the "jQuery" object as argument to the function. This object was transparently defined when loading the jQuery library.

        Here is some typical code I use and that avoids some problems due to the "$"
        (function(jQuery) {
        ...
        )(jQuery)


        This should help. At least, I hope so. wink

        Julien
          • 2878
          • 81 Posts
          Thank you all for the suggestions.
          After reading them I restarted XAMPP and rechecked the pages and now everything works
          until I log back into the MODx manager??? Is this the quick manager issue?

          bauhaus9
            • 2878
            • 81 Posts
            Quote from: Mark at Jun 29, 2010, 08:06 AM

            A link could be useful wink

            Is AjaxSearch automatically including the jQuery library also, causing a conflict? What about QuickManager?

            I’m not sure what version of jQuery AjaxSearch needs nowadays, but perhaps try disabling automatic including of the libraries and instead manually including a later version to accommodate your navigation as well as AS. http://docs.jquery.com/Downloading_jQuery

            Sorry I could not provide a link I’m using XAMPP on my computer until I get the basics worked out then I’ll go live with it.
            You are spot on, it was QuickManager that caused the problem.
            I’ve turned it off, for now. I really was not using it at all.
            Thank you one and all for the help!
            bauhaus9
              • 18373 ☆ A M B ☆
              • 3,141 Posts
              Quote from: bauhaus9 at Jun 29, 2010, 11:56 AM

              I’ve turned it off, for now. I really was not using it at all.

              If you decide you do want to use QM sometime later, you can also disable the automatic including of jQuery (you just need to make sure you have included it yourself then).

              Elements -> Manage Elements -> Plugins -> QuickManager -> Configuraton, set "Load jQuery in front-end" to "false".
                Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                • 2878
                • 81 Posts
                Quote from: Mark at Jun 29, 2010, 12:27 PM

                Quote from: bauhaus9 at Jun 29, 2010, 11:56 AM

                I’ve turned it off, for now. I really was not using it at all.

                If you decide you do want to use QM sometime later, you can also disable the automatic including of jQuery (you just need to make sure you have included it yourself then).

                Elements -> Manage Elements -> Plugins -> QuickManager -> Configuraton, set "Load jQuery in front-end" to "false".

                Thank you.
                I will have to test this out.
                bauhaus9