How to prevent javascript and css to render on some drupal pages

Warning message

JQuery Cycle must be installed in order to run the slideshow. Please go to Status Report for instructions.

Primary tabs

We enable all the "performance settings" which includes "javascript and css optimization" . Sometimes that javascript or css optimization can conflict on various pages and create various bugs, disturb the design of our page, misplace the elements on the page.

To prevent from this, we can disable the JS or CSS to render on that particular pages. To do this we have to use drupal's global configuration variable . Suppose you want to prevent JS and CSS on blog creation page then  :

 global $conf;

 if((arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'blog')) {
         $conf['preprocess_css'] = FALSE;
         $conf['preprocess_js'] = FALSE;