Some modules insert JavaScript at top of list. I put my $sctipts variable at the bottom of html.tpl.php file just before the closing of body tag. Due to this, some scripts do not work as they get called before jquery or drupal.js . Please provide steps to reorder list of js. I tried this code in my template.php but with no effect:
function MYTHEME_js_alter(&$javascript) {
$javascript['sites/all/modules/syntaxhighlighter/syntaxhighlighter.min.js']['group'] = 500;
$javascript['sites/all/modules/syntaxhighlighter/syntaxhighlighter.min.js']['weight'] = 500;
}
Solved. I did this: enabled AdvAgg Modifier, Advanced CSS/JS Aggregation. Then I visited settings page /admin/config/development/performance/advagg/mod where I checked options: Enable preprocess on all JS, Move all inline scripts to the bottom of the execution order, Move all browser conditional JavaScript to the bottom of the group, Move JS to the footer - All. And now i have all JS in the bottom (as google recommends), without need to chane html.tpl.php