We launched new forums in March 2019—
join us there
.
In a hurry for help with your website?
Get Help Now!
Back to MODX.com
Forums
Docs
Revo Issues
Blog
My Forums
General
General Discussions
Search
Where in MODx can I put Javascript code?
<
1
2
>
284 Posts
novolo
Reply #11,
15 years, 3 months ago
You actually can see best practice here:
https://github.com/smooth-graphics/modx-boilerplate/tree/master/assets/templates/main
in header and footer. It’s not easy and you have to understand how the DOM-load is working in a browser to know where to put into.
MODX Free Template Base:
MODX-Boilerplate
|
my blog
(lots of MODX stuff) |
my gitHub
(translations) |
MODX User Groups Germany
(Facebook)
☆ A M B ☆
318 Posts
freejung
Reply #12,
15 years, 3 months ago
Best practice is to do it before closing body tag
Not if you’re loading it asynchronously - the current version of Google Analytics tracking script, for example, goes in the head and loads asynchronously.
<
1
2
>