Sometimes the head is the best place to put the javascript. I didn't look into what javascript they are loading there, but there are times the user experience is improved by it.
Sometimes the head is the best place to put the javascript. I didn't look into what javascript they are loading there, but there are times the user experience is improved by it.
That actually makes <head> the preferred place for loading scripts.
Also, I find it a bit extreme to recommend putting inline javascript in a <script> tag. I'm ok with trying to maximize performances, but please, do not recommend to produce un-seperated and unclean code. Concatenating javascript in a single file (and compressing it) is way enough, having one single request to get all javascript is not so bad.
<script><%= File.read("file.js") %></script>
Not that they should literally move the script inline.You wouldn't want the page to load first and then this appear.
Or, if something only works with js, don't show it until the scripts have loaded, but let plain content load & render in the meantime.
But I assume that in Apple's case, they are doing it even when they shouldn't be.