6. The jQuery Utility Functions

jQuery has a number of utility functions built in to make everyday JavaScript tasks easier. These functions are named jquery.XXX( ), where XXX( ) is the name of the function. You can also refer to them as $.XXX( ).

For example, the $.trim( ) function trims spaces from strings.

The utility functions can’t really be categorized. They are just a group of useful functions that jQuery offers to augment JavaScript—to make tasks in JavaScript easier. You could duplicate what they do in JavaScript yourself, but it takes far less time to use a utility function.

Examples of jQuery Utility Functions

jQuery offers many utility functions that work with arrays, such as the $.isArray( ) function; you pass this function an array, ...

Get jQuery: Visual QuickStart Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.