Skip to main content

JavaScript

Responding to various mouse clicks with jQuery

Mouse has been the primary medium of input for decades. Normally there are three types of mouse click. They are left, right and middle click.

In jQuery, we all knew there is a click() method acts as event handler to capture this action. 

Ganesan Fri, 08/01/2014 - 05:03
knackforge blog knowledge base
Translatable strings

Translatable strings in Drupal JavaScript

Drupal is known for being highly translatable. The localization team has done a fantastic job building out tools to make Drupal translatable and it's rare to find a contrib module that doesn't properly wrap its strings in the t() function or the lesser known format_plural() function. While the Drupal community is doing fairly well on the PHP side, many people don't know there is a translation system for Drupal JavaScript as well through the use of Drupal.t() functions and Drupal.formatPlural() functions. 

Drupal.t() function

Subscribe to JavaScript