jQuery MiscellaneousMethod
jQuery Miscellaneous Method
Method | Description |
---|
data() | Append data to the selected element, or get data from the selected element |
##each() | Execute the function for each matching element |
get() | Get the DOM element specified by the selector |
index() | Search for a given element from matching elements |
$.noConflict() | Release jQuery control of variable $ |
$.param() | Creates a serialized representation of an array or object (can be used in a URL query string when generating an AJAX request) |
removeData() | Remove previously stored data |
size() | In Deprecated in version 1.8. Returns the number of DOM elements matched by the jQuery selector |
toArray() | Retrieve all DOM elements contained in the jQuery collection in the form of an array |
pushStack() | Add a collection of DOM elements to the jQuery stack |
$.when() | Provides a method to execute the callback function of one or more objects |
jQuery Utilities
Method | Description |
---|
$.boxModel | Deprecated in version 1.8. Detect whether the browser is using the W3C's CSS box model to render the current page |
$.browser | Deprecated in version 1.9. Return relevant information about the browser currently used by the user |
$.contains() | Determine whether another DOM element is a descendant of the specified DOM element |
$.each() | Traverse the specified object and array |
$.extend() | Merge the contents of one or more objects into the target object |
$.fn.extend() | Extend one or more instance properties and methods for jQuery |
$.globalEval() | Execute a piece of JavaScript code globally |
$.grep() | Filter and return array elements that satisfy the specified function |
$.inArray() | Find the specified value in the array and return its index value (if not found, Then return -1) |
$.isArray() | Determine whether the specified parameter is an array |
$.isEmptyObject () | Check whether the object is empty (does not contain any attributes) |
$.isFunction() | Determine whether the specified parameter is a function |
$.isNumeric() | Determine whether the specified parameter is a numeric value |
$.isPlainObject() | Judge whether the specified parameter is a pure object |
$.isWindow() | Judge whether the specified parameter is a window |
$.isXMLDoc() | Determine whether a DOM node is located in an XML document, or it is an XML document itself |
$.makeArray() | Convert an array-like object to a real array object |
$.map() | Specify the function to process each element in the array (or Each attribute of the object), and encapsulates the processing result into a new array and returns |
$.merge() | Merge the contents of the two arrays into the first array |
$.noop() | An empty function |
$.now() | Return Current time |
$.parseHTML() | Parse the HTML string into the corresponding DOM node array |
$. parseJSON() | Convert a JSON string that conforms to the standard format into the corresponding JavaScript object |
$.parseXML() | Convert the characters The string is parsed into the corresponding XML document |
$.trim() | Remove the blank characters at both ends of the string |
##$ .type() | Determine the type of JavaScript built-in objects |
$.unique() | Deprecated in jQuery 3.0. Sort the DOM element array and remove duplicate elements |
$.uniqueSort() | Sort the DOM element array and remove duplicate elements Element |
$.data() | Access data on the specified element and return the set value |
$.hasData() | Determine whether an element has associated jQuery data |
$.sub() | Create a new copy of jQuery, Its properties and methods can be modified without affecting the original jQuery object |
$.speed | Create an object containing a set of properties to define custom animations |
$.htmlPrefilter() | Modify and filter HTML strings through jQuery operation methods |
$.readyException() | Handling errors thrown synchronously by functions wrapped in jQuery() |
jQuery callback object
The jQuery.Callbacks() function new in jQuery 1.7 version returns a multi-functional object. This object provides a powerful method to manage the callback list. It can add, delete, trigger, and disable callback functions.
Method | Description |
---|
$.Callbacks() | A multi-purpose Callback list object, used to manage the callback function list |
callbacks.add() | Add a callback or a collection of callbacks to the callback list |
callbacks.disable() | Disable the callback function in the callback list |
callbacks.disabled() | Determine the callback list Whether it has been disabled |
callbacks.empty() | Empty all callbacks from the list |
callbacks.fire( ) | Pass in the specified parameters to call all callbacks |
callbacks.fired() | Determine whether the callback has been called at least once |
callbacks.firewith() | The given context and parameters access all callbacks in the list |
callbacks.has() | Determine whether a callback function has been added to the callback list |
callbacks.lock() | Lock the callback list of the current state |
callbacks.locked() | Determine whether the callback list is locked |
callbacks.remove() | From the callback list Delete a callback or callback collection |
jQuery Deferred Object
Introduced in jQuery 1.5, the Deferred deferred object is a chainable utility object created by calling the jQuery.Deferred() method. It can register multiple callback functions to the callback list, call the callback list and pass the success or failure status of asynchronous or synchronous functions.
A deferred object is chainable, similar to the way a jQuery object is chainable, except that it has its own methods. After creating a Deferred object, you can use any of the following methods to link directly to the object that was created or saved by calling one or more of its methods.
Method | Description |
---|
$.Deferred() | Returns a chained utility object method To register multiple callbacks |
deferred.always() | When the Deferred (deferred) object is accepted or rejected, the added handler is called |
deferred.done() | When the Deferred object is accepted, the added handler is called |
deferred.fail( ) | When the Deferred object is rejected, the added handler is called |
deferred.isRejected() | From jQuery1 .7 has been obsolete, determine whether the Deferred object has been rejected |
deferred.isResolved() | has been obsolete since jQuery1.7, determine whether the Deferred object has been resolved |
deferred.notify() | Given a parameter, call the callback function (progressCallbacks) on the delayed object |
deferred.notifyWith() | Given the context and parameters, call the progressCallbacks function on the delay object |
deferred.pipe() | Utility method for filtering and/or chained delay objects |
deferred.progress() | When Deferred When the (delayed) object generates a progress notification, call the add handler |
deferred.promise() | Return the Deferred (delayed) Promise object |
deferred.reject() | Reject the Deferred (deferred) object and call any failCallbacks callback function based on the given parameters |
deferred.rejectWith () | Reject the Deferred object and call any failCallbacks callback function based on the given context and args parameters |
deferred.resolve() | Resolve the Deferred (delay) object and call any doneCallbacks callback function based on the given parameters |
deferred.resolveWith() | Resolve the Deferred (delay) object, And call any doneCallbacks callback function based on the given context and args parameters |
deferred.state() | Determine the current state of a Deferred object |
deferred.then() | Add handler is called when the Deferred object is resolved, rejected, or is still in progress |
.promise() | Return a Promise object to observe whether all actions of a certain type bound to the collection have been added to the queue |