diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 63f02bb3c1..920b958460 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -193,6 +193,12 @@ function test_ajax() { }, (jqXHR, textStatus, errorThrown) => { console.log(jqXHR, textStatus, errorThrown); }); + + // jqXHR object + var jqXHR = $.ajax({ + url: "test.js" + }); + jqXHR.abort('aborting because I can'); } function test_ajaxComplete() { diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index a1a3a32c58..f675f3944b 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -168,7 +168,9 @@ interface JQueryXHR extends XMLHttpRequest, JQueryPromise { */ overrideMimeType(mimeType: string): any; /** - * Cancel the request. Pass the statusText as textStatus parameter for done callback, "canceled" will be passed if not provided. + * Cancel the request. + * + * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" */ abort(statusText?: string): void; /**