Open pablopaul opened 10 years ago
One issue with jQuery getting loaded in the bottom is that not all plugins use jQuery correctly. They don't wrap any code in the document.ready() function, but instead go straight to using $('element').whatever(), so if you move it to the bottom, then that script will not execute. Creating a theme that loads every script in the footer is not good practice, since you can't control all your variables. If you want to load jQuery at the bottom in your child theme, then use a function to remove Cornerstone's parent js loads and replace it with your own. Then you can load what you want where you want it.
In my humble opinion a theme should head to best practices, in that case it means load all scripts in the footer, especially in the case of a foundation5 theme, which aims for speed!
If somebody uses this theme with a plugin which is not following the best practice in case of script loading he can still remove the default way and use the "wrong" way in the child theme. I definitely vote for making the better case default while providing a "fall back" solution, but not vice versa: Doing it wrong and providing a fall back to make it right…
Hi @thewirelessguy , is there any specific reason why jQuery gets loaded in the head?
I suggest to move it to the bottom, ok?