Would a page load faster if I keep all my JavaScript in a separate file say MyCode.js and include that file rather than have the JavaScript included in the html file?
Or does it not really matter?
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.
It very rarely matters for speed purposes unless you’re Google. However, for readability and maintainability, it’s much better to keep your JavaScript in external files.
If you put your
<script>tags at the end of the page (just before the closing<body>tag) the JavaScript won’t block loading of the page.