mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add jQuery.ajax test to verify a bug.
The definition does not leverage the returned value of $.ajax()
method well. The official syntax is
```
jqXHR.then(function( data, textStatus, jqXHR ) {}, function( jqXHR, textStatus, errorThrown ) {});
```
(From: http://api.jquery.com/jQuery.ajax/)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user