Question: I am creating a custom module in drupal 7 and adding a js file in sites/all/libraries folder but its not working.Please check my code 

```
function mymodule_library(){
$libraries['mymodule'] = array(
    'title' => 'My custom', 
    'website' => 'http://www.test.com/test', 
    'version' => '1.7.14',
    'js' => array(
      'sites/all/libraries/mymod/custom.js' => array(),
    ),
);
return $libraries;

```

}

Answer: 
That code just registers the library with the system. To use it, you need to add it to the page with either

```
drupal_add_library('mymodule', 'mymodule');

```

or as part of a render array:

```
$build['#attached']['library'][] = array('mymodule', 'mymodule');

```
use [drupal\_add\_js()](https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_add_js/7)

for calling a file ,, your code should be somehting like this:

```
drupal_add_js('sites/all/libraries/mymod/custom.js','file');

```