I am new to Drupal and I am trying to create a module that requires js. I have successfully created the module. I have successfully created the script.js file. Now I tried to include other js files $.include('script2.js') but it does not work. It should be that easy, right?
Then I tried a different method. The template.php
if ($hook == 'page') {
// Add the script.js file
drupal_add_js(path_to_theme() .'/script2.js');
// Reload the scripts variable to include the added file
$vars['scripts'] = drupal_get_js();
return $vars;
}
return array();
}
and the page.tpl.php method
print _phptemplate_variables($hook, $vars);
?>
but it does not work either, it only adds the follwoing lines to my source:
<script type="text/javascript"> </script>
Array
What's up with that!?
Thanks for any suggestions,
Tiffany









