Adding JS and CSS Dynamically to Override Theme In Drupal 7 I'm trying to add JavaScript and CSS to dynamically modify the content in a theme. I've spent a good amount of time going over the Drupal documentation, several Drupal books, and the questions/answers on here. I'm trying to pull it all together, but I'm not sure how close I am and was hoping to get some feedback/help. What I have done so far:

(1) Created a CSS file with the code below called knitr.css and put it in the css folder

pre .operator,

pre .number {
 color: rgb(0, 0, 205);
}

pre .string {
 color: rgb(3, 106, 7);
}


(2) Created a JS file with the code below called jquery.knitr.js and put it in the js folder (note, to save space I have removed the js code)

var hljs=new function()
hljs.initHighlightingOnLoad();

 })(jQuery);


(3) Added the following code into the preprocess_node function of the template.php file. Important: responsive and page need to be changed to your theme name and the machine name for your content, respectively.

if ($variables['view_mode'] == 'full') {
$node =&amp; $variables['node'];
if ($node-&gt;type == 'page') {
$path = drupal_get_path('theme', 'responsive');
drupal_add_css($path . '/css/knitr.css');
drupal_add_js($path . '/js/jquery.knitr.js', array('type' =&gt; 'file', 
'scope' =&gt;  'header'));
 }
}


(4) Placed the follwong in the basic content page with as full HTML text format

&lt;/head&gt;

&lt;body&gt;
&lt;pre&gt;&lt;code class="r"&gt;1 + 2
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;## [1] 3
&lt;/code&gt;&lt;/pre&gt;


 
Expected output:

I expect the output on the page to look something like the following at this point. The JavaScript and the CSS should be changing the font color of 1+2 to blue (wasn't sure how to change color for example below). I'm getting no errors from what I've done above, but it is not implementing as expected.

1 + 2
## [1] 3
If the style sheet is used on all your pages, there's no need to load it dynamically with drupal_add_js(). Just put your style sheet into the .info file of your theme. The Writing theme .info files guide has detailed descriptions and links to more docs about this.
Your JS script looks fundamentaly wrong to me. Remove the script tag alltogether.
To add the JS script just add scripts[] = foo.js to your theme .info file. Look at the above mentionded guide, or here to get more detials.
What do you mean with basic content page.