We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21419
    • 84 Posts
    What is the best practice when including jQuery on my site without having it called twice when I’m logged in as an admin (as the QuickManager generates it own script tag)?

    I’d like to use a single jquery.js for any plugins or scripting I create as well as any MODx extras I install and would like to eliminate any unnecessary duplication. Anyone have any ideas?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I use a snippet, and check for manager login. If a manager is not logged in, then I use $modx->regClientStartupScript() to load the libraries. You could even make it a plugin if you wanted to, but adding a snippet to your template is not a big deal.
        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
        • 21419
        • 84 Posts
        Thanks!