diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 79dda3e54..30cb2111a 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -150,6 +150,15 @@ function test_ajax() { url: "test.js", dataType: "script" }); + + // treat $.ajax() as a promise (as of 1.8) + $.ajax({ + url: "test.js" + }).then((data, textStatus, jqXHR) => { + console.log(data, textStatus, jqXHR); + }, (jqXHR, textStatus, errorThrown) => { + console.log(jqXHR, textStatus, errorThrown); + }); } function test_ajaxComplete() {