Magento 2.1.2 bundled with jQuery 1.11. How it possible to replace it with jQuery 2.1?
-
1Why u want to replace? By replacing JS it will cause so many issues.Jackson– Jackson2016年12月14日 02:29:58 +00:00Commented 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.Sarvesh Patel– Sarvesh Patel2019年07月11日 07:53:19 +00:00Commented Jul 11, 2019 at 7:53
3 Answers 3
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
-
3This doesn't work for version 2.2.4Frank Groot– Frank Groot2018年06月18日 07:29:15 +00:00Commented Jun 18, 2018 at 7:29
-
1hi @Ankit, can you update the full code, with require js?Jafar Pinjar– Jafar Pinjar2019年10月30日 11:05:31 +00:00Commented Oct 30, 2019 at 11:05
-
1Does not work. Tried in 2.3Black– Black2020年01月08日 15:52:25 +00:00Commented Jan 8, 2020 at 15:52
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
Change the jquey file in lib folder.
lib/web/jquery.js