It’s a best practice storing scripts like js, or css, in an external file, the only exception to this rule is for lightweight script specific for a page like the following example:
1 2 3 |
$(function() { alert('do something'); }); |
inside the other circumstances the external file…