javascript - Why alert from external JS not appearing -


this question has answer here:

why no alert appear in following html?

my html

<!doctype html> <html> <head lang="en">     <meta charset="utf-8">     <title></title>     <script src="a.js"/> </head> <body>  </body> <html> 

a.js

alert("hello"); 

you can't have self closing script tag. change script tag to:

<script src="a.js"></script> 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -