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

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -