What is jQuery?
- A library that makes it quicker and easier to build JavaScript webpages and web apps.
- Enables you to write a single line of code that usually would have taken 10-20 lines of regular JavaScript code.
- Actually written in JavaScript, and comes in the form of a single .js file that you link to from your webpage.
Your JavaScript code then accesses the library by calling various jQuery functions.
How does it help developers?
- More time efficient - developers can write a single line code in jQuery that would normally take many more times.
- Cross-browser javascript code - it allows developers to write and run their JS code on all different browsers by simply using the right jQuery function.
Why do we have 2 version of jQuery â minified and uncompressed?
- well here is why;
Minified.js file ;
- has all comments, whitespace, and other unnecessary characters removed from the file, squeezing the whole library into a mere 23kb.
- Although you canât easily read the code, this is the version youâll want to place on your site, as itâs much quicker for visitors to download.
Uncompressed.js file;
- easy to read and modify, but itâs around 160kb in size (back in 2010).
- Thus, much larger in size and would take longer to download by visitors on your website.