Page 1 of 1

Where to load jQuery

Posted: Tue Oct 21, 2025 8:06 pm
by ArtcoInc
(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

Re: Where to load jQuery

Posted: Tue Oct 21, 2025 8:48 pm
by burt
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