Hello everyone,
I am under Drupal 7.43 and I wonder how to add multiples JS files in the footer of a page.
For example I have files "file1.js", "file2.js" "file3.js"...... and I want to load them in the footer so I proceed with an template_preprocess_html(&$vars) so the code looks like this:

function theme_preprocess_html(&$variables){
  $path = drupal_get_path('theme', 'myTHEME');
  $js = array(
    $path . 'js/file1.js',
    $path . 'js/file2.js',
    ...
  );

  drupal_add_js( $js , array(
    'scope' => 'footer'
  ));
}

But it doesn't work. Any ideas please ?

Thank you very much for your help!

Comments

VM’s picture

have you worked through : https://www.drupal.org/node/756722 ?

dx007’s picture

and I don't see how to figure out my case.

Thanks!