Hope someone can explain it to me that how does the external js file work when we include them by script tags.
does it work just like the css file?
thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to understand that HTML is the document which a browser renders. There are various other resources that you can include
When the browser loads the document(HTML) (as part of your initial HTTP request), it tries to dereference the resources being referred to.
If there are references to any of the above resources, then the browser issues additional HTTP requests to get the resources.
If you are have javascript embedded in the HTML document, then the browser doesn’t interpret it rather the javascript engine (part of the browser) interprets the script and runs it.
Edit
Also, please refer the answer provided by Marc B.
I suggest you to run the debugger in any of the modern browser to understand how the request for resources are made.