We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8548
    • 104 Posts
    Having this probleme and I figure that it must have a solution that I did not find yet... if you guys could help me.
    on every snippet added to the revo, I get one more jquery.min.js loaded, and they juste add up,

    3 snippet and I get 3 call to get jquery.min.js, they're must be some way to stop this?

    thanks for helping the guy new to revo laugh [ed. note: Egam last edited this post 10 years, 10 months ago.]
      • 33238
      • 388 Posts
      That is so weird because the snippets and the jquery has nothing in common!
      i think you need to check the code inside the snippet, may be it is calling the jquery.
      Usually with modx you just need to call the jquery in the head, and that is enough to use it in your site, snippets are php codes, if it is calling something is because it is inside the snippet!
        --
        ysanmiguel.com
        • 8548
        • 104 Posts
        Yes it's insinde those snippets, mxcalendar and avsearch for example both put the
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

        so I have it in to places in the head, but for my how jquery that I have to put in I need the 1.9.1 fils wich I've added in the head of my template... so I have 3 jquery.min.js loading for same page.

        in mxcalendar I've deativated the modal view and forced the js file in my template so I've eliminated one, still have to...
          • 33238
          • 388 Posts
          Delete the ones inside the snippets and leave only the one that you need in the head of your template!
            --
            ysanmiguel.com
            • 8548
            • 104 Posts
            that's what I started doing but tought there might be some simpler way in revo to manage this.

            would be a good thing laugh

            thanks for your help
              • 33238
              • 388 Posts
              Good, your welcome!
              and please add [Solved] the title!

              Cheers!
                --
                ysanmiguel.com
              • Most snippets have a property to load the JQuery library or not.

                AdvSearchForm has a property in its Properties tab if you don't want to use &addJQuery=`0` as a property in the snippet tags. http://rtfm.modx.com/display/ADDON/AdvSearch.AdvSearchForm#AdvSearch.AdvSearchForm-Custominstallation

                MxCalendar has addJQ, so you can use &addJQ=`0` as a property in the snippet call. http://rtfm.modx.com/display/ADDON/mxCalendar
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 8548
                  • 104 Posts
                  Thanks sottwell

                  but will this anable me to use jquery call for snippet anyway?
                  • If you want the snippet to add the jquery library, just don't add the property. They'll add the library by default (&addJQuery=`1`)

                    This property is useful for when you have more than one snippet that wants to add a jQuery library, or if you have it manually in your template. I usually have it in my template when most if not all pages will be using it, so I don't have to worry about which version is getting installed.

                    Most plugins that need it will also have a configuration property to have the plugin install the library or not; check the documentation for your plugins and snippets.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org