(For those of us still on old versions of Phoenix, and still using jQuery ...)
Where is the best place on a page to load it? When I had it loading in the footer, I was getting error(s):
Uncaught ReferenceError: $ is not defined
When I moved loading it up in the header, these went away (and resolved some other problems I was having).
Is there a problem with loading jQuery in the header instead of the footer?
TIA
Malcolm
Where to load jQuery
- burt
- Core Team
- Posts: 4546
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Where to load jQuery
Wherever. In admin of 1.0.3.0 it is loaded in header.
In shop it is loaded in Footer via Hook.
Where it is loaded will affect the speed your site loads.
You simply need to make sure that any jQuery usage comes after jQuery is loaded.
Or...don't use jQuery at all, which is the preferred solution, but would be a lot of work to achieve in v1.0.3.0
In shop it is loaded in Footer via Hook.
Where it is loaded will affect the speed your site loads.
You simply need to make sure that any jQuery usage comes after jQuery is loaded.
Or...don't use jQuery at all, which is the preferred solution, but would be a lot of work to achieve in v1.0.3.0
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.