
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
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.
- Related Articles
- How to Append Contents of Multiple Files Into One File on Linux?
- Python - Write multiple files data to master file
- Which one is better to use for a JavaScript link, “#” or “javascript:void(0)”?
- Is it possible to have multiple try blocks with only one catch block in java?
- Why is it important to update all the software to have better security?
- Which one is better POW() or POWER() in MySQL?
- How to merge multiple files into a new file using Python?
- How to spilt a binary file into multiple files using Python?
- How to open multiple files using a File Chooser in JavaFX?
- Better ways to modify string with multiple methods using JavaScript
- Which one is better to insert NULL or empty string in MySQL?
- Which one is better in MySQL - NULL or empty string?
- Which one is better Build, Rebuild, or Clean in C#?
- Python Pandas- Create multiple CSV files from existing CSV file
- Saving multiple figures to one PDF file in matplotlib

Advertisements