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:
Junle Li
2014-06-10 23:30:45 +08:00
parent e713407390
commit a6d7470f12
+9
View File
@@ -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() {