0
Why in JavaScript I can't write <script src="script.js">alert("Hello")</script>
Does if I put external file in src I can't write something between script tag??? Why is that so???
2 Answers
+ 4
you're right. such features are spelled out in the specification. either an external script or an internal script. the advantage is outside
+ 3
You can use another script tag in which src is not mentioned. Or you can use import modules in javascript file. There is always good to have external js file. But it is more good have different modules in separated files