Articles tagged with Javascript

Writing my first browser extension with WXT

Posted on
In the last few months, I have worked on expanding my knowledge in web development by learning new technologies. I explored more of the Vue.js world and played around with many new libraries and patterns. Meanwhile working on work stuff I missed a good (or more suitable for me) extension that can fill forms with test data so I decided to put two things together - wanting to learn something new and improve my development workflow.

What is once() in Drupal and do you still need it?

Posted on
JavaScript plays a crucial role in modern web development, enhancing the interactivity and user experience of websites and web applications. In the context of Drupal, a powerful and flexible content management system, JavaScript is utilized to create dynamic and responsive interfaces, making websites more engaging and user-friendly.

How to use Drupal once()

Posted on
Drupal implements its own Javascript API. Most of the time, all code should use behaviors that trigger every time something changes on the page - page loaded, ajax request, and so on. On the other hand, it causes issues with code executing more than one time.

How to migrate from jQuery.once()

Posted on
Drupal 10 removed old jQuery.once() plugin and replaced it with separate library in plain JavaScript. Existing scripts need to be updated, but there are some things to look out and they won't work as it might be assumed.