Page 1 of 1

JQuery load order?

Posted: Sat 07 Jun 2014 6:03 pm
by duke
Usually I would load all my scripts and JQuery in my footer template for faster page loading. But, if I have only one template that requires a particular script, can the link for that be placed in the template that requires it before the call to "jquery-latest.min.js"?

Re: JQuery load order?

Posted: Sat 07 Jun 2014 6:06 pm
by mcrossley
If the template script isn't dependent on JQuery then yes it can, otherwise it can't :?

Re: JQuery load order?

Posted: Sat 07 Jun 2014 7:05 pm
by duke
That's what I assumed but I failed to find a definitive answer.

So my solution would be to call "jquery-latest.min.js" in the header and the frequently used scripts in the footer. Then any 'one off' scripts can be called on the required template.

Re: JQuery load order?

Posted: Sat 07 Jun 2014 9:59 pm
by mcrossley
Sounds about right. I have to put JQuery in my header too because the page formatting uses it with some in-line code, most of the scripts are at the end of the body.

Re: JQuery load order?

Posted: Sun 08 Jun 2014 5:26 am
by duke
Thanks Mark.