What is the difference between drupal_add_js()
and $form['#attached']['js'][]
?
When is the purpose of using each of the above functions?
(I mean I know that it is used to attached js to say form if used inside form but when is drupal_add_jsdrupal_add_js
used and when is $form['#attached']['js'][]$form['#attached']['js'][]
used ?)