Relax Breath of Solution.Community tech blog of Sameera Thilakasiri - Consultant UI, UX, RWD Specialist/ Interactive Designer

Just I wanted.. Do you?…

jQuery Utility Functions

Posted on August 28, 2011 | Comments Off on jQuery Utility Functions

.clearQueue()
This function is used to remove all the functions from the queue that have not been executed.

jQuery.contains()
The jQuery.contains() function is used to check if a DOM node is within another DOM node.
eg:-
jQuery.contains( container, contained )
jQuery.contains(document.documentElement, document.body); // true
jQuery.contains(document.body, document.documentElement); // false

jQuery.data()
The jQuery.data() function is used to add data of any type to a DOM element..
eg:-
jQuery.data( element, key, value )
Note: this method currently does not provide cross-platform support for setting data on XML documents, as Internet Explorer does not allow data to be attached via expando properties.

.dequeue()
The .dequeue() function is used to remove the next function on the queue.

jQuery.dequeue()
The jQuery.dequeue() is used to execute the next function on the queue for the matched element.

jQuery.each()
The jQuery.each() function is not same as .each(), which is used to iterate over the jQuery objects. The jQuery.each() iterates through the array displaying each number as both a word and numeral.
eg:-
var map = {
‘flammable’: ‘inflammable’,
‘duh’: ‘no duh’
};
$.each(map, function(key, value) {
alert(key + ‘: ‘ + value);
});

result-
flammable: inflammable
duh: no duh

jQuery.extend()
The jQuery.extend() function merge the contents of two or more objects together into the first object.
eg:-
jQuery.extend( [deep,] target, object1, [objectN] )
deepIf true, the merge becomes recursive (aka. deep copy).
targetThe object to extend. It will receive the new properties.
object1An object containing additional properties to merge in.
objectNAdditional objects containing properties to merge in.

jQuery.globalEval()
Execute some JavaScript code globally.

jQuery.grep()
The jQuery.grep() function is used to find the elements of an array which satisfy a filter function. The original array is not affected.

jQuery.inArray()
The jQuery.inArray() function searches for a specified value within an array and return its index (or -1 if not found).

jQuery.isArray()
The jQuery.isArray() function is used to determine whether the argument is an array.

jQuery.isEmptyObject()
The jQuery.isEmptyObject() function is used to check to see if an object is empty (in order words contains no properties).

jQuery.isFunction()
The jQuery.isFunction() is used to determine if the argument passed is a Javascript function object.

jQuery.isPlainObject()
The function jQuery.isPlainObject() is used to find if an object is a plain object (created using “{}” or “new Object”).

jQuery.isXMLDoc()
The jQuery.isXMLDoc() function is used to find if a DOM node is within an XML document (or is an XML document).

jQuery.makeArray()
The function jQuery.makeArray() is used to convert an array-like object into a true JavaScript array.

jQuery.map()
The function jQuery.map() translates all items in an array or array-like object to another array of items.

jQuery.merge()
The function jQuery.merge() merge the contents of two arrays together into the first array.

jQuery.noop()
The jQuery.noop() is an empty function.

jQuery.parseJSON
The jQuery.parseJSON function takes a well-formed JSON string as parameter and then returns the resulting JavaScript object.

jQuery.proxy()
The jQuery.proxy() function Takes a function and returns a new one that will always have a particular context.

.queue()
It shows the queue of functions to be executed on the matched elements.

jQuery.queue()
It shows the queue of functions to be executed on the matched element.

jQuery.removeData()
This function is used to remove a previously-stored piece of data.

jQuery.support
Properties of the Global jQuery Object.

jQuery.trim()
It is used to remove the whitespace from the beginning and end of a string.

jQuery.unique()
The jQuery.unique() function sorts an array of DOM elements, in place, with the duplicates removed.


Author
Sameera Thilakasiri By Sameera Thilakasiri
,is a front-end developer based in Colombo, is a blogger and a lifestyle photographer.
Follow him Twitter and Google+. Check out him.

Comments

Comments are closed.