Does an external .js file require internal and containing tags to work?
Does an external .js file require internal and containing tags to work?
No, <script> tags are not needed otherwise error occurs.
For example, external.js has alert function with <script> tags.
<script>
alert('external')
</script>
Then, external.js is added to index.html.
<script type="text/javascript" src="external.js"></script>
Then, error occurs. (I used google chrome)
Uncaught SyntaxError: Unexpected token '<'
So, only alert function is fine without <script> tags.
alert('external')