While reading the API page for drupal_add_js, I kept wondering what is the best practice to include inline JavaScript or a JS file.
It seems like it works exactly the same even if you omit 'file', 'external' or 'inline' like in this example :
Without 'file'
drupal_add_js('misc/collapse.js');
With 'file'
drupal_add_js('misc/collapse.js', 'file');
So the question is rather simple. Why would I choose one over another and what is the standard way of coding this ?
Thanks !