What will you learn
- How JavaScript is loaded and used within Drupal
- Using Drupal.behaviors
- Using Drupal.theme for HTML markup
- Passing dynamic server-side settings to JavaScript for use in client-side scripts
- Drupal's JavaScript coding standards and ESLint
Overview
Using JavaScript in Drupal allows you to add interactive and dynamic functionalities to your site, enhancing user engagement and allowing for richer client-side experiences.
Develop with JavaScript in Drupal
Integrate JavaScript in Drupal modules or themes
This course covers the basics of loading JavaScript using asset libraries, the use of the Drupal.behaviors API to ensure proper execution of scripts, and best practices for writing maintainable and standards-compliant JavaScript. Additionally, learners will explore advanced topics such as using drupalSettings for server-side configurations, leveraging Modernizr for feature detection, and ensuring code quality with ESLint.