Include javascript in node
The Drupal way is to add js on the go is drupal_add_js

drupal_add_js($data = NULL, $options = NULL)


Examples:

  drupal_add_js('misc/collapse.js');
  drupal_add_js('misc/collapse.js', 'file');
  drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });', 'inline');
  drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });',
    array('type' =&gt; 'inline', 'scope' =&gt; 'footer', 'weight' =&gt; 5)
  );
  drupal_add_js('http://example.com/example.js', 'external');
  drupal_add_js(array('myModule' =&gt; array('key' =&gt; 'value')), 'setting');


There is a better way to add a library file drupal_add_library

Parameters


$module:
The name of the module that registered the library.

$name:
The name of the library to add.

$every_page:
Set to TRUE if this library is added to every page on the site. Only items
with the every_page flag set to TRUE can participate in aggregation.