
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Is it better to have one big JavaScript file or multiple light files?
To avoid multiple server requests, group your JavaScript files into one. Whatever you use for performance, try to minify JavaScript to improve the load time of the web page.
If you are using single page application, then group all the scripts in a single file.
If you are using multiple files, then minify all of your scripts and separate them into categories.
example
<script src =”/js/core.js”> - Place JavaScript to be used in every page. This can be the core script of the file. <script src =”/js/plugins.js”> - Place your plugins here
Rest, add other scripts in a JavaScript file. It’s good to maintain it in different files.
Advertisements