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?
-
☆ 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.