Adding Javascript to Page / Block / Form
1. Adding to JS to homepage
=====================
In your template.php add this.
function yourtheme_preprocess_page(&$vars) {
if(drupal_is_front_page()) {
drupal_add_js(drupal_get_path('theme', 'yourtheme') . '/js/your-front-script.js');
}
}
=====================
In your template.php add this.
function yourtheme_preprocess_page(&$vars) {
if(drupal_is_front_page()) {
drupal_add_js(drupal_get_path('theme', 'yourtheme') . '/js/your-front-script.js');
}
}
Comments
Post a Comment