1

This issue I recently faced, I was trying to import multiple js files in my HTML page like this -

<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js" />
<script src="lib/js/backbone.js" />

But the issue I was facing is, it was loading only the first js file and the rest of the js file was not getting loaded. I also checked the network section in the browser, the remaining two file was just not getting called. Then I changed the syntax to this -

<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
<script src="lib/js/backbone.js"></script>

And then the loading of all the 3 files happened successfully. My question is, is

<script src="" /> 

a wrong syntax or is this issue only specific to me?

Rito
  • 3,092
  • 2
  • 27
  • 40

1 Answers1

8

Script tag requires both the starting and ending tag. From MDN:

Tag omission: None, both the starting and ending tag are mandatory.

Nisarg Shah
  • 14,151
  • 6
  • 34
  • 55