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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.