How do I include jQuery scripts at the bottom of the  tag? I want to include a JavaScript file at the bottom of the &lt;body&gt; tag, and I only want to  include it for a specific node type, but my node.tpl.php file's content is only wrapped by &lt;article&gt; tag; there is no ` tag in this file. If I do this in the root template.tpl.php file, it will effect all pages, which is not what I want.

Can I do this via theme preprocess functions?
The example on the documentation for drupal_add_js() can explain this.

drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });',
  array('type' =&gt; 'inline', 'scope' =&gt; 'footer', 'weight' =&gt; 5)
);


If you want to add jQuery files, just change 'type' to 'file'.