Move aggregated JS file to the footer Is there a method of moving the aggregated JS files to the footer?   I've taken a look at hook_js_alter but that just gives me access to the individual files, not the aggregated ones.

I would prefer to not move the $scripts variable to the bottom of html.tpl.php

Any tips would be appreciated.
Found this excellent code snippet for Drupal 7: https://gist.github.com/pascalduez/1418121

It offers a way to have $script and $head_scripts so that you can specify which JS files need to go in the head. Example, Modernizr should go into the head scripts.

I'm copy pasting below the solution in the link to future proof the answer.

Cheers.

html.tpl.php

&lt;!DOCTYPE html&gt;
&lt;html&lt;?php print $html_attributes; ?&gt;&gt;
&lt;head&gt;
&lt;?php print $head; ?&gt;
&lt;title&gt;&lt;?php print $head_title; ?&gt;&lt;/title&gt;
&lt;?php print $styles; ?&gt;
&lt;?php print $head_scripts; ?&gt;
&lt;/head&gt;

&lt;body&lt;?php print $body_attributes;?&gt;&gt;
&lt;?php print $page_top; ?&gt;
&lt;?php print $page; ?&gt;
&lt;?php print $scripts; ?&gt;
&lt;?php print $page_bottom; ?&gt;
&lt;/body&gt;
&lt;/html&gt;


template.php
    

// Used in conjunction with https://gist.github.com/1417914

/**
* Implements hook_preprocess_html().
*/
function THEMENAME_preprocess_html(&amp;$vars) {
// Move JS files "$scripts" to page bottom for perfs/logic.
// Add JS files that *needs* to be loaded in the head in a new "$head_scripts" scope.
// For instance the Modernizr lib.
$path = drupal_get_path('theme', 'THEMENAME');
drupal_add_js($path . '/js/modernizr.min.js', array('scope' =&gt; 'head_scripts', 'weight' =&gt; -1, 'preprocess' =&gt; FALSE));
}

/**
* Implements hook_process_html().
*/
function THEMENAME_process_html(&amp;$vars) {
$vars['head_scripts'] = drupal_get_js('head_scripts');
}