4

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

2
  • 1
    Why u want to replace? By replacing JS it will cause so many issues.
    – Jackson
    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. 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

3
  • 3
    This doesn't work for version 2.2.4 Jun 18, 2018 at 7:29
  • 1
    hi @Ankit, can you update the full code, with require js? Oct 30, 2019 at 11:05
  • 1
    Does not work. Tried in 2.3
    – Black
    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

1

Change the jquey file in lib folder.

lib/web/jquery.js

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.