Welcome to the Treehouse Community
Looking to learn something new?
Header Include with JQuery
Can anyone help? I was trying to create an Inc folder with a header.php file; however when I use the file, the jquery stuff stops working? I think it's because page 1 links to one type of jquery slider and page 2 links to another type of jquery sliders and I have different css files for different things. What a mess! ;)
Here's the question: Do i just make an exhaustive list of all the jquery links and css files add it to the header.php file OR can i simply not use header.php includes if I have multiple pages with different jquery elements and css elements? So maybe keep the header.php for the simply pages and just a la carte the other pages.
Kevin Korte28,109 Points
If you go your second route, than everytime you'll need to update the menu, or some other common header, item, you'll have to make that change on every file, yuck.
How many CSS and JS files do you have? Each on of those is a server request, and therefor a hit to performance. You'd be better off turning all of your CSS files into one or two larger ones. And than think about moving the JS files to the footer.