How to add multiple js files in hook_field_widget_form()? When I load two JS files using drupal_add_js() as can be seen in the code marked "After", it does not show alert() text on page load and also when I click on the button created in the form to load fancybox (popup) it shows 

$.fancybox is not a function


When I just add taxonomy_fancybox.js it shows alert, so my question is 
How can I make sure both fancybox.js and taxonomy_fancybox.js are loaded.

Before

/**
 * Implements hook_field_widget_form().
 */
function taxonomy_fancybox_field_widget_form(&amp;$form, &amp;$form_state, $field, $instance, $langcode, $items, $delta, $element) {

  drupal_add_js(drupal_get_path("module", "taxonomy_fancybox") . '/taxonomy_fancybox.js');
}


After

/**
 * Implements hook_field_widget_form().
 */
function taxonomy_fancybox_field_widget_form(&amp;$form, &amp;$form_state, $field, $instance, $langcode, $items, $delta, $element) {
  drupal_add_js(drupal_get_path('module', 'fancybox') . '/fancybox.js');
  drupal_add_js(drupal_get_path("module", "taxonomy_fancybox") . '/taxonomy_fancybox.js');
}


taxonomy_fancybox.js has

(function ($) {
  Drupal.behaviors.selectterms = {
    attach: function (context, settings) {

      alert('enters');

      $('#edit-select-terms').click(function (e) {

        e.preventDefault();

        $.ajax({
          url: '/ajax/fetch-vocabularies/',
          success: function (data) {
            $.fancybox(data);
          }
        });

      });

    }
  };
}(jQuery));
Seems you missed step 3. from the README.


  
  Download the fancyBox plugin and extract the entire directory into    sites/all/libraries. (You may need to create this directory). The path
  to    fancyBox should be
  sites/all/libraries/fancybox/source/jquery.fancybox.js.    (the module
  uses the minified version, so actually jquery.fancybox.pack.js).
  


The second JS then doesn't fire anymore as the first JS virtually raised an exception already (due to the non-existent 3rd party library).