How to Update jQuery in Project

Posted By : Vivek Uniyal | 26-Aug-2019

Introduction: Jquery is lightweight and featured javascript library which is widely used in our day to day projects.

 

Why we use Jquery: jquery is nothing but javascript but more featured, jquery provide good features to our script which might hard to achieve by simple javascript.

 

Why do we need to update jquery: like every library jquery also provide frequent updates it can be by removing some buggy functions or adding new features to it which helps to run a fast and flawless script.

 

Jquerymigrate: jquery migrate is also a javascript library which helps us to preserve the deprecated functionalities in the code, if we are using some old version of jquery and we need to upgrade it so we need the upgraded version of the jquery imported and then the migrate library under that import to handle the deprecated functionalities in the code. After doing so you will see all the warnings in the console so that you can resolve it.

 

How to use Jquerymigrate: well it is simple but a step by step process which we need to keep in mind.

 

  •  To upgrade our code to jQuery 3.0, we first need to go to version 1.12.x or 2.2.x. If we are using an older version, first we need an upgrade to one of these versions using jQuery Migrate 1.x, to resolve any compatibility issues.

 

  •  If we are on version 1.12.x or 2.2.x. we can upgrade our jQuery by using jQuery Migrate 3.x, to resolve any compatibility issues.

 

After doing the above steps you might get some warning in your console when you open the page.

you can resolve all of these warnings by reading the jQuery Migrate document.

 

If there is no warning and only "JQMIGRATE: Migrate is installed with logging active, version x.x.x" this message is showing then it means you have successfully updated your jQuery.

 

 

note: you have to repeat this process to all of your pages in the project.

 

after this, you can remove the jQuery Migrate from your project.

 

thanks for reading my post happy jQuery upgrading.

you can read more on https://github.com/jquery/jquery-migrate.

About Author

Author Image
Vivek Uniyal

Vivek is a Front-end developer and has knowledge of Angular, HTML 5, CSS 3, Bootstrap, and JavaScript. he also has working knowledge of Back-end as well.

Request for Proposal

Name is required

Comment is required

Sending message..