Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
102
rated 0 times [  104] [ 2]  / answers: 1 / hits: 21449  / 12 Years ago, tue, october 30, 2012, 12:00:00

I have the following:



    $.ajax(link.href,
{
cache: false,
dataType: 'html'
})
.done(onDialogDone)
.fail(onDialogFail);


This works fine and onDialogDone is called. However what arguments should I expect to see supplied to the onDialogDone and what should I expect to see for onDialogFail.



The reason I am asking is because I use typescript and I want to supply the correct arguments when I define my onDialogDone and onDialogFail.


More From » ajax

 Answers
7

The arguments for .done() and .fail() are the same as the arguments for the corresponding success: and error: parameters for the $.ajax() function, namely:



.done( function(data, textStatus, jqXHR) { ... } );


and



.fail( function(jqXHR, textStatus, errorThrown) { ... } );


For the purposes of typescript, textStatus and errorThrown are strings, jqXHR is an Object, and data depends on what the remote server sends you.


[#82280] Sunday, October 28, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
byrondonavanc

Total Points: 675
Total Questions: 107
Total Answers: 105

Location: Peru
Member since Fri, Oct 14, 2022
2 Years ago
byrondonavanc questions
;