Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Introduction to jQuery


May 07, 2021 jQuery


Table of contents


Introduction to jQuery


The jQuery library can be added to a Web page with a simple line of tags.


The basics you need to have

Before you start learning jQuery, you should have a basic understanding of:

  • Html
  • Css
  • Javascript

If you need to learn these subjects first, find these tutorials on our home page.


What is jQuery?

jQuery is a JavaScript library.

jQuery is a lightweight "write less, do more" JavaScript library.

The jQuery library contains the following features:

  • HTML element selection
  • HTML element operations
  • CSS operation
  • HTML event function
  • JavaScript effects and animations
  • HTML DOM traversal and modification
  • Ajax
  • Utilities

Tip: In addition, Jquery offers a number of plug-ins.


Why use jQuery?

There are a lot of open source JS frameworks on the network today, but jQuery is the most popular JS framework today and offers a lot of extensions.

Many large companies are using jQuery, for example:

  • Google
  • Microsoft
  • Ibm
  • Netflix
Introduction to jQuery Does jQuery work for all browsers?

The jQuery community knows that JS has a number of compatibility issues in different browsers, and jQuery is currently compatible with all major browsers, including Internet Explorer 6!

The jQuery version is supported

When using jQuery, you should be aware that version jQuery 2 above does not support IE6, 7, 8 browsers. So if you're using IE6, 7, 8 browsers, you'll have to choose to use jQuery 1.9, or you can use conditional annotations to allow only jQuery 1.9 when using IE6, 7,8 browsers.

The comment code is as follows:

<!--[if lt IE 9]> 
    <script src="jquery-1.9.0.js"></script> 
<![endif]--> 
<!--[if gte IE 9]><!--> 
    <script src="jquery-2.0.0.js"></script> 
<!--<![endif]-->

Replace the jQuery library

If you want to put jQuery inventory on your computer, you can load CDN jQuery core files from Google or Microsoft based on Google and Microsoft's friendliness to jQuery.

Use Google's CDN

<head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs /jquery/1.4.0/jquery.min.js"></script> </head>

Use Microsoft's CDN

<head> <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery /jquery-1.4.min.js"></script> </head>