What does this line in javascript mean? Its located in an html file
<script src="js/main.js"></script>
What does this line in javascript mean? Its located in an html file
<script src="js/main.js"></script>
It adds the main.js file which is under js folder to your html file. Now you can use its methods in your javascript code
When your browser renders the HTML code, it stops at your mentioned line, makes a GET request for the file (relative path => Current address + js/main.js
) and will then parse the main.js file.
After that the browser will continue to render the HTML and after that execute, what's in main.js
.
It is the default way to include Javascript files to a website.