 <p>There's nothing wrong with adding script elements mixed in the middle of the <code>body</code>, however if you want to improve loading times, you might want to append the <code>script</code> elements to <code>footer.php</code>. Having scripts called after the rest of the dom has loaded will prevent the loading of the scripts from blocking the rest of the page from rendering.</p> <p>If it's a very small script, I see no reason not to just add them inline where it'll be easy to see what elements they affect.</p>