4

Magento 2.1.2 bundled with jQuery 1.11. How it possible to replace it with jQuery 2.1?

asked Dec 13, 2016 at 21:24
2
  • 1
    Why u want to replace? By replacing JS it will cause so many issues. Commented Dec 14, 2016 at 2:29
  • When I will add FB.init that time need to add function with ajax post, so I need to add other jquery. and comes issue so let me figure out this. Commented Jul 11, 2019 at 7:53

3 Answers 3

-1

Original file path is here

magento\vendor\magento\magento2-base\lib\web\jquery.js

You should overwrite in your theme so path will be

magento\app\design\frontend\Custom\YourTheme\web\js\jquery.js

How to override JS file

Extending/overriding JS in Magento 2

answered Dec 14, 2016 at 2:40
3
  • 3
    This doesn't work for version 2.2.4 Commented Jun 18, 2018 at 7:29
  • 1
    hi @Ankit, can you update the full code, with require js? Commented Oct 30, 2019 at 11:05
  • 1
    Does not work. Tried in 2.3 Commented Jan 8, 2020 at 15:52
5

Correct place to put jquery update is "your_theme"/web/jquery.js dont forget to propper cleare caches just now got it working. Also jquery-migrate.js needs to be updated and seems that patch for jquery.mobile.custom.js needed and fix for knockout/template/rendered.js to fix self closing nodes.

Magento 2.4

answered Nov 11, 2021 at 14:11
1

Change the jquey file in lib folder.

lib/web/jquery.js

answered May 20, 2019 at 7:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.