I have several jQuery scripts that are used on my website, but not on every page. I place these scripts in a PHP conditional so that it only outputs them on the required pages.
Now what I'm wondering is: is this considered good practice? Does this speed up the website? Are there even any positive aspects to using this method?
<?php if ( is_home() ) { ?>
<script>
//jQuery code
//jQuery code
//jQuery code
</script>
<?php } ?>