Skip to content

ajaxPromise

Official

Sends an AJAX request and returns a promise.

Example:

const response = await ajaxPromise({ url: 'https://example.com' });
console.log(response);

Signature:

function ajaxPromise(options: AjaxOptions): Promise<any>

Parameters:

ParameterTypeDescription
optionsAjaxOptionsThe options for the AJAX request.

Returns: Promise<any> — A promise that resolves to the response.

Example:

const response = await ajaxPromise({ url: 'https://example.com' });
console.log(response);