If i put my .js files in sites->all->libraries folder. Will drupal recognize it ? Because i did not see the file in the source. Can i make it recognize ?


Just putting the files in a directory won't do any good.

You have to either put a reference to your file in your module.info file, or use drupal_add_js somewhere, depending on what you're trying to achieve.

  • 1
    sites/all/libraries/ exists so that modules can know where you've put various non-Drupal code libraries. There's a Libraries module, and contrib modules can declare it a dependency so that you know you're supposed to use an external library in there. Basically: Don't put anything there unless you're installing a module that tells you to do so. Countzero's answer is correct about how to add JS to your site. – paul-m Feb 18 '12 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.