Interface JQueryStatic

Static members of jQuery (those on $ and jQuery themselves)

Index

Call signatures

Properties

Methods

Call signatures

(selector: string, context?: Element): JQuery

Accepts a string containing a CSS selector which is then used to match a set of elements.

Parameters

  • selector: string

    A string containing a selector expression

  • context?: Element optional

    A DOM Element, Document, or jQuery to use as context

Returns

JQuery

(selector: string, context?: JQuery): JQuery

Accepts a string containing a CSS selector which is then used to match a set of elements.

Parameters

  • selector: string

    A string containing a selector expression

  • context?: JQuery optional

    A DOM Element, Document, or jQuery to use as context

Returns

JQuery

(element: Element): JQuery

Accepts a string containing a CSS selector which is then used to match a set of elements.

Parameters

  • element: Element

    A DOM element to wrap in a jQuery object.

Returns

JQuery

(elementArray: Array<Element>): JQuery

Accepts a string containing a CSS selector which is then used to match a set of elements.

Parameters

  • elementArray: Array<Element>

    An array containing a set of DOM elements to wrap in a jQuery object.

Returns

JQuery

(object: {}): JQuery

Accepts a string containing a CSS selector which is then used to match a set of elements.

Parameters

  • object: {}

    A plain object to wrap in a jQuery object.

Returns

JQuery

(object: JQuery): JQuery

Accepts a string containing a CSS selector which is then used to match a set of elements.

Parameters

  • object: JQuery

    An existing jQuery object to clone.

Returns

JQuery

(): JQuery

Specify a function to execute when the DOM is fully loaded.

Returns

JQuery

(html: string, ownerDocument?: Document): JQuery

Creates DOM elements on the fly from the provided string of raw HTML.

Parameters

  • html: string

    A string of HTML to create on the fly. Note that this parses HTML, not XML.

  • ownerDocument?: Document optional

    A document in which the new elements will be created.

Returns

JQuery

(html: string, attributes: Object): JQuery

Creates DOM elements on the fly from the provided string of raw HTML.

Parameters

  • html: string

    A string defining a single, standalone, HTML element (e.g.

    or
    ).

  • attributes: Object

    An object of attributes, events, and methods to call on the newly-created element.

Returns

JQuery

(callback: Function): JQuery

Binds a function to be executed when the DOM has finished loading.

Parameters

  • callback: Function

    A function to execute after the DOM is ready.

Returns

JQuery

Properties

public Event: JQueryEventConstructor

public ajaxSettings: JQueryAjaxSettings

public colorpicker: JQueryColorpickerStatic

public cssHooks: { [key: string]: any; }

Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.

(): any

Returns

any

public cssNumber: any

public expr: any

public fn: any

public fx: { tick: () => void; interval: number; stop: () => void; speeds: { slow: number; fast: number; }; off: boolean; step: any; }

Effects

public fx.interval: number

The rate (in milliseconds) at which animations fire.

public fx.off: boolean

Globally disable all animations.

public fx.speeds: { slow: number; fast: number; }

public fx.step: any

public fx.stop: () => void

public fx.tick: () => void

public speeds.fast: number

public speeds.slow: number

public isReady: boolean

public param: JQueryParam

Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.

public support: JQuerySupport

Methods

public Callbacks(flags?: string): JQueryCallback

A multi-purpose callbacks list object that provides a powerful way to manage callback lists.

Parameters

  • flags?: string optional

    An optional list of space-separated flags that change how the callback list behaves.

Returns

JQueryCallback

public Deferred(beforeStart?: (deferred: JQueryDeferred<T>) => any): JQueryDeferred

A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.

Parameters

  • beforeStart?: (deferred: JQueryDeferred<T>) => any optional

    A function that is called just before the constructor returns.

Returns

JQueryDeferred

public ajax(settings: JQueryAjaxSettings): JQueryXHR

Perform an asynchronous HTTP (Ajax) request.

Parameters

  • settings: JQueryAjaxSettings

    A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().

Returns

JQueryXHR

public ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR

Perform an asynchronous HTTP (Ajax) request.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • settings?: JQueryAjaxSettings optional

    A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().

Returns

JQueryXHR

public ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any)

Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().

Parameters

  • dataTypes: string

    An optional string containing one or more space-separated dataTypes

  • handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any

    A handler to set default values for future Ajax requests.

public ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any)

Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().

Parameters

  • handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any

    A handler to set default values for future Ajax requests.

public ajaxSetup(options: JQueryAjaxSettings)

Set default values for future Ajax requests. Its use is not recommended.

Parameters

  • options: JQueryAjaxSettings

    A set of key/value pairs that configure the default Ajax request. All options are optional.

public contains(container: Element, contained: Element): boolean

Check to see if a DOM element is a descendant of another DOM element.

Parameters

  • container: Element

    The DOM element that may contain the other element.

  • contained: Element

    The DOM element that may be contained by (a descendant of) the other element.

Returns

boolean

public data(element: Element, key: string, value: T): T

Store arbitrary data associated with the specified element. Returns the value that was set.

Parameters

  • element: Element

    The DOM element to associate with the data.

  • key: string

    A string naming the piece of data to set.

  • value: T

    The new data value.

Returns

T

public data(element: Element, key: string): any

Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.

Parameters

  • element: Element

    The DOM element to associate with the data.

  • key: string

    A string naming the piece of data to set.

Returns

any

public data(element: Element): any

Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.

Parameters

  • element: Element

    The DOM element to associate with the data.

Returns

any

public dequeue(element: Element, queueName?: string)

Execute the next function on the queue for the matched element.

Parameters

  • element: Element

    A DOM element from which to remove and execute a queued function.

  • queueName?: string optional

    A string containing the name of the queue. Defaults to fx, the standard effects queue.

public each(collection: Array<T>, callback: (indexInArray: number, valueOfElement: T) => any): any

A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.

Parameters

  • collection: Array<T>

    The object or array to iterate over.

  • callback: (indexInArray: number, valueOfElement: T) => any

    The function that will be executed on every object.

Returns

any

public each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any

A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.

Parameters

  • collection: any

    The object or array to iterate over.

  • callback: (indexInArray: any, valueOfElement: any) => any

    The function that will be executed on every object.

Returns

any

public error(message: any): JQuery

Takes a string and throws an exception containing it.

Parameters

  • message: any

    The message to send out.

Returns

JQuery

public extend(target: any, object1?: any, objectN?: Array<any>): any

Merge the contents of two or more objects together into the first object.

Parameters

  • target: any

    An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument.

  • object1?: any optional

    An object containing additional properties to merge in.

  • objectN?: Array<any> optional

    Additional objects containing properties to merge in.

Returns

any

public extend(deep: boolean, target: any, object1?: any, objectN?: Array<any>): any

Merge the contents of two or more objects together into the first object.

Parameters

  • deep: boolean

    If true, the merge becomes recursive (aka. deep copy).

  • target: any

    The object to extend. It will receive the new properties.

  • object1?: any optional

    An object containing additional properties to merge in.

  • objectN?: Array<any> optional

    Additional objects containing properties to merge in.

Returns

any

public get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR

Load data from the server using a HTTP GET request.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any optional

    A callback function that is executed if the request succeeds.

  • dataType?: string optional

    The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).

Returns

JQueryXHR

public get(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR

Load data from the server using a HTTP GET request.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • data?: Object optional

    A plain object or string that is sent to the server with the request.

  • success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any optional

    A callback function that is executed if the request succeeds.

  • dataType?: string optional

    The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).

Returns

JQueryXHR

public get(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR

Load data from the server using a HTTP GET request.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • data?: string optional

    A plain object or string that is sent to the server with the request.

  • success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any optional

    A callback function that is executed if the request succeeds.

  • dataType?: string optional

    The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).

Returns

JQueryXHR

public getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR

Load JSON-encoded data from the server using a GET HTTP request.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any optional

    A callback function that is executed if the request succeeds.

Returns

JQueryXHR

public getJSON(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR

Load JSON-encoded data from the server using a GET HTTP request.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • data?: Object optional

    A plain object or string that is sent to the server with the request.

  • success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any optional

    A callback function that is executed if the request succeeds.

Returns

JQueryXHR

public getJSON(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR

Load JSON-encoded data from the server using a GET HTTP request.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • data?: string optional

    A plain object or string that is sent to the server with the request.

  • success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any optional

    A callback function that is executed if the request succeeds.

Returns

JQueryXHR

public getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR

Load a JavaScript file from the server using a GET HTTP request, then execute it.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any optional

    A callback function that is executed if the request succeeds.

Returns

JQueryXHR

public globalEval(code: string): any

Execute some JavaScript code globally.

Parameters

  • code: string

    The JavaScript code to execute.

Returns

any

public grep(array: Array<T>, func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): Array<T>

Finds the elements of an array which satisfy a filter function. The original array is not affected.

Parameters

  • array: Array<T>

    The array to search through.

  • func: (elementOfArray: T, indexInArray: number) => boolean

    The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object.

  • invert?: boolean optional

    If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.

Returns

Array<T>

public hasData(element: Element): boolean

Determine whether an element has any jQuery data associated with it.

Parameters

  • element: Element

    A DOM element to be checked for data.

Returns

boolean

public holdReady(hold: boolean)

Holds or releases the execution of jQuery's ready event.

Parameters

  • hold: boolean

    Indicates whether the ready hold is being requested or released

public inArray(value: T, array: Array<T>, fromIndex?: number): number

Search for a specified value within an array and return its index (or -1 if not found).

Parameters

  • value: T

    The value to search for.

  • array: Array<T>

    An array through which to search.

  • fromIndex?: number optional

    he index of the array at which to begin the search. The default is 0, which will search the whole array.

Returns

number

public isArray(obj: any): boolean

Determine whether the argument is an array.

Parameters

  • obj: any

    Object to test whether or not it is an array.

Returns

boolean

public isEmptyObject(obj: any): boolean

Check to see if an object is empty (contains no enumerable properties).

Parameters

  • obj: any

    The object that will be checked to see if it's empty.

Returns

boolean

public isFunction(obj: any): boolean

Determine if the argument passed is a Javascript function object.

Parameters

  • obj: any

    Object to test whether or not it is a function.

Returns

boolean

public isNumeric(value: any): boolean

Determines whether its argument is a number.

Parameters

  • value: any

Returns

boolean

public isPlainObject(obj: any): boolean

Check to see if an object is a plain object (created using "{}" or "new Object").

Parameters

  • obj: any

    The object that will be checked to see if it's a plain object.

Returns

boolean

public isWindow(obj: any): boolean

Determine whether the argument is a window.

Parameters

  • obj: any

    Object to test whether or not it is a window.

Returns

boolean

public isXMLDoc(node: Node): boolean

Check to see if a DOM node is within an XML document (or is an XML document).

Parameters

  • node: Node

    he DOM node that will be checked to see if it's in an XML document.

Returns

boolean

public makeArray(obj: any): Array<any>

Convert an array-like object into a true JavaScript array.

Parameters

  • obj: any

    Any object to turn into a native Array.

Returns

Array<any>

public map(array: Array<T>, callback: (elementOfArray: T, indexInArray: number) => U): Array<U>

Translate all items in an array or object to new array of items.

Parameters

  • array: Array<T>

    The Array to translate.

  • callback: (elementOfArray: T, indexInArray: number) => U

    The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object.

Returns

Array<U>

public map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any

Translate all items in an array or object to new array of items.

Parameters

  • arrayOrObject: any

    The Array or Object to translate.

  • callback: (value: any, indexOrKey: any) => any

    The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object.

Returns

any

public merge(first: Array<T>, second: Array<T>): Array<T>

Merge the contents of two arrays together into the first array.

Parameters

  • first: Array<T>

    The first array to merge, the elements of second added.

  • second: Array<T>

    The second array to merge into the first, unaltered.

Returns

Array<T>

public noConflict(removeAll?: boolean): Object

Relinquish jQuery's control of the $ variable.

Parameters

  • removeAll?: boolean optional

    A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).

Returns

Object

public noop(): any

An empty function.

Returns

any

public now(): number

Return a number representing the current time.

Returns

number

public parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): Array<any>

Parses a string into an array of DOM nodes.

Parameters

  • data: string

    HTML string to be parsed

  • context?: HTMLElement optional

    DOM element to serve as the context in which the HTML fragment will be created

  • keepScripts?: boolean optional

    A Boolean indicating whether to include scripts passed in the HTML string

Returns

Array<any>

public parseHTML(data: string, context?: Document, keepScripts?: boolean): Array<any>

Parses a string into an array of DOM nodes.

Parameters

  • data: string

    HTML string to be parsed

  • context?: Document optional

    DOM element to serve as the context in which the HTML fragment will be created

  • keepScripts?: boolean optional

    A Boolean indicating whether to include scripts passed in the HTML string

Returns

Array<any>

public parseJSON(json: string): any

Takes a well-formed JSON string and returns the resulting JavaScript object.

Parameters

  • json: string

    The JSON string to parse.

Returns

any

public parseXML(data: string): XMLDocument

Parses a string into an XML document.

Parameters

  • data: string

    a well-formed XML string to be parsed

Returns

XMLDocument

public post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR

Load data from the server using a HTTP POST request.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any optional

    A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.

  • dataType?: string optional

    The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).

Returns

JQueryXHR

public post(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR

Load data from the server using a HTTP POST request.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • data?: Object optional

    A plain object or string that is sent to the server with the request.

  • success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any optional

    A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.

  • dataType?: string optional

    The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).

Returns

JQueryXHR

public post(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR

Load data from the server using a HTTP POST request.

Parameters

  • url: string

    A string containing the URL to which the request is sent.

  • data?: string optional

    A plain object or string that is sent to the server with the request.

  • success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any optional

    A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.

  • dataType?: string optional

    The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).

Returns

JQueryXHR

public proxy(fnction: (...args: any[]) => any, context: Object, additionalArguments?: Array<any>): any

Takes a function and returns a new one that will always have a particular context.

Parameters

  • fnction: (...args: any[]) => any

    The function whose context will be changed.

  • context: Object

    The object to which the context (this) of the function should be set.

  • additionalArguments?: Array<any> optional

    Any number of arguments to be passed to the function referenced in the function argument.

Returns

any

public proxy(context: Object, name: string, additionalArguments?: Array<any>): any

Takes a function and returns a new one that will always have a particular context.

Parameters

  • context: Object

    The object to which the context (this) of the function should be set.

  • name: string

    The name of the function whose context will be changed (should be a property of the context object).

  • additionalArguments?: Array<any> optional

    Any number of arguments to be passed to the function named in the name argument.

Returns

any

public queue(element: Element, queueName?: string): Array<any>

Show the queue of functions to be executed on the matched element.

Parameters

  • element: Element

    A DOM element to inspect for an attached queue.

  • queueName?: string optional

    A string containing the name of the queue. Defaults to fx, the standard effects queue.

Returns

Array<any>

public queue(element: Element, queueName: string, newQueue: Array<Function>): JQuery

Manipulate the queue of functions to be executed on the matched element.

Parameters

  • element: Element

    A DOM element where the array of queued functions is attached.

  • queueName: string

    A string containing the name of the queue. Defaults to fx, the standard effects queue.

  • newQueue: Array<Function>

    An array of functions to replace the current queue contents.

Returns

JQuery

public queue(element: Element, queueName: string, callback: Function): JQuery

Manipulate the queue of functions to be executed on the matched element.

Parameters

  • element: Element

    A DOM element on which to add a queued function.

  • queueName: string

    A string containing the name of the queue. Defaults to fx, the standard effects queue.

  • callback: Function

    The new function to add to the queue.

Returns

JQuery

public removeData(element: Element, name?: string): JQuery

Remove a previously-stored piece of data.

Parameters

  • element: Element

    A DOM element from which to remove data.

  • name?: string optional

    A string naming the piece of data to remove.

Returns

JQuery

public trim(str: string): string

Remove the whitespace from the beginning and end of a string.

Parameters

  • str: string

    Remove the whitespace from the beginning and end of a string.

Returns

string

public type(obj: any): string

Determine the internal JavaScript [[Class]] of an object.

Parameters

  • obj: any

    Object to get the internal JavaScript [[Class]] of.

Returns

string

public unique(array: Array<Element>): Array<Element>

Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.

Parameters

  • array: Array<Element>

    The Array of DOM elements.

Returns

Array<Element>

public when(deferreds?: JQueryGenericPromise[]): JQueryPromise

Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.

Parameters

  • deferreds?: JQueryGenericPromise[] optional

    One or more Deferred objects, or plain JavaScript objects.

Returns

JQueryPromise

public when(deferreds?: Array<T>): JQueryPromise

Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.

Parameters

  • deferreds?: Array<T> optional

    One or more Deferred objects, or plain JavaScript objects.

Returns

JQueryPromise

public when(deferreds?: Array<any>): JQueryPromise

Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.

Parameters

  • deferreds?: Array<any> optional

    One or more Deferred objects, or plain JavaScript objects.

Returns

JQueryPromise