I work on drupal 7, I added all js by info file, work well in whole site. But we want to remove or not load of a specific js in a specific content type page.
I try by template.php of following code
function mytheme_preprocess_page(&$vars) {
if (isset($vars['node']->type) && !empty($vars['node']->type) && ($vars['node']->type == 'my_content_type')) {
$js_path = drupal_get_path('theme', 'mytheme') . "/js/xyz.js";
unset($vars[$js_path]);
}
}
but load xyz.js. How to remove of this js file.