What's the best way to call jQuery scripts, in HTML/PHP template, or seperate js file?
- by j-man86
StackOverflow is telling me this is a subjective question, but I think it's a matter of fact!
I have a number of scripts that I'm using on different parts of my site. In terms of making fewer http requests, I know it's better to combine all of these scripts into one .js file. However, isn't a waste of time for a page to call a .js full of 10 or 15 different functions when it's only using one?
The other method I am using is to use PHP conditional statements...
<?php if( is_page() ) { >
$(document).ready(function(){
...
});
<?php } ?>
What's the best method or comination of these methods?