Magento 2 : Requirejs, Calling a js file universally in magento 2 Posted on September 29, 2020 | by Saphal | Leave a Comment on Magento 2 : Requirejs, Calling a js file universally in magento 2Calling a js in all the pages of Magento 2, use below code in your requirejs-config.js: HTMLvar config = { deps: [ 'JS_NAME' ], paths: { JS_NAME: 'Vendor_ModuleName/js/JS_FILE', } };
Magento 2 – How to use jQuery in magento 2? Posted on September 11, 2020 | by Saphal | Leave a Comment on Magento 2 – How to use jQuery in magento 2? JSrequire([ 'jquery', 'jquery/ui'], function($){ $(document).ready(function($) { console.log('running'); // your script }); });