Loading module-related files only on certain pages I installed the Chosen module and it is conflicting with my JavaScript code. That module gets loaded on every page, even if there is no select box on the page. It is definitely unnecessary to load the files from that module when they are not necessary at all. 

What I want to do is modifying the module to only load on certain pages.

How should I go about doing this? What function do I have to call or look for within that module?
You should use hook_js_alter() within template.php

function yourthemename_js_alter(&amp;$javascript) {
  if ('this is true') {
    unset($javascript['sites/all/modules/chosen/chosen.js']);
  }
}


I'm wondering if either solution will result in caching issues though.  If I may: I would first try to figure out why my JavaScript collides with the module and fix it there.

You can also use the hook within a custom module if you already have one that relates to what you're trying to accomplish here.