Introduction to jQuery

jQuery is an javascript library, which is small, fast, feature-rich.

It can work across different number of browsers.

Using jQuery operation such as Ajax, event handling, animation and even more can be done.

In general studying jQuery can be easy or somewhat challenging depending on one's knowledge on HTML, CSS and programming concepts.


jQuery plugin

First one should add jQuery plugin before using jQuery methods.

jQuery plugin is open source and free to download, so anyone can use.

jQuery plugin should be imported using <script> tag.

Syntax

<script src=".../jquery.min.js"></script>


Content Delivery Network (CDN)

CDN can be included if a user doesn't want to download or host jQuery by themselves.

Some CDN websites are cloudflare, cdnjs.com, google, microsoft and even more.

Usage of CDN website

  • Different domains - concurrent connections to a single domain are limited. For example from a single domain one can download upto 4files at a time, when the 5th file is set to download it has to wait until the first download is finished. CDN files are hosted in different domains so these files can be download concurrent with the other download without any delay.
  • pre-cached - When a person visit a website which contain CDN files, those will be cached in the local system. So when he visit another website which also contains the same CDN files it won't be downloaded again since those files are already cached.
  • High-capacity infrastructures - CDNs offer lower packet loss, higher availability, lower network latency.
  • Built-in version control - It can request latest version of CSS file or JavaScript library automatically.
  • Distributed data centers - It can provide localized data centers that are close to the user and provide faster downloads.
  • Usage analytics - It provide file usage reports which can be used for ones own website analytics.
  • Boosts performance and saves money - It can save bandwidth, distribute the load, reduce your existing hosting costs and boost performance.

In our website we use cloudflare CDN.