jQuery:Added generic always/done/fail/progress

This commit is contained in:
John Reilly
2013-11-19 11:39:58 +00:00
parent 40b93ee4a9
commit a9752fc8fd
2 changed files with 18 additions and 0 deletions
+12
View File
@@ -898,6 +898,18 @@ function test_dblclick() {
}
function test_deferred() {
function returnPromise(): JQueryPromise<(data: { MyString: string; MyNumber: number; }, textStatus: string, jqXHR: JQueryXHR) => any> {
return $.ajax("test.php");
}
var x = returnPromise();
x.done((data, textStatus, jqXHR) => {
var myNumber: number = data.MyNumber;
var myString: string = data.MyString;
var theTextStatus: string = textStatus;
var thejqXHR: JQueryXHR = jqXHR;
});
$.get("test.php").always(function () {
alert("$.get completed with success or error callback arguments");
});