RequireJS and jQuery
Now that we’ve had a quick introduction to the JavaScript frameworks that are used in the Adobe Commerce (AC) platform, let’s set sail and learn how to navigate the waters of RequireJS and jQuery.
In this chapter, you’ll learn how to work with RequireJS, create scripts, and add any custom third-party JavaScript to your theme. Our small journey will consist of the following aspects:
- A small introduction to RequireJS and how it is embedded in the platform
- How to add custom JavaScript to the theme using RequireJS
- How to initialize RequireJS files in the template files
- Working with jQuery inside your custom JavaScript files
- How to create and extend jQuery widgets
- How to modify or override objects or methods using RequireJS
This chapter is the key to understanding how AC works with JavaScript, with RequireJS as its source, since anything JavaScript-related goes – or rather should go – through RequireJS...