, drupal_add_js() hook_preprocess_page() . JavaScript, drupal_add_js(), $scripts template_preprocess_page(), hook_preprocess_page() template_preprocess_page(). , , drupal_add_js() .tpl.php (), $scripts:
function THEME_preprocess_page(&$variables)
drupal_add_js(...);
$variables['scripts'] = drupal_get_js();
}
But you do not need to add jquery.jsit drupal.jsyourself, it should be done automatically using the Drupal core. If you need to do this yourself, something will break on your site. You can (re) add files as a quick fix, but it's better to find the root cause of the problem, as this most likely creates other problems that you have not yet identified (or did not work without realizing it).
source
share