Adding a script to certain pages
You should try below solution as well. I have added JS &amp; CSS for the specific node.

function YOURTHEME_preprocess_page(&amp;$variables){
  if (array_key_exists('node', $variables)) {
    $node = $variables['node'];
    if ($node-&gt;nid == 8) {
      drupal_add_css(path_to_theme() . '/css/cdata.css', array('group' =&gt; CSS_THEME, 'media' =&gt; 'screen', 'every_page' =&gt; TRUE, 'browsers' =&gt; array('IE' =&gt; 'gte IE 9', '!IE' =&gt; FALSE), 'preprocess' =&gt; FALSE));    
      drupal_add_js(path_to_theme() .'/js/custom_records.js', 'file');
    }
  }  
}