且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在ajax .done中为函数提供了哪些参数?

更新时间:2023-11-27 17:31:46

.done() .fail()$的参数c $ c>与相应的成功的参数相同:错误: $。ajax() 功能,即:

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) { ... } );

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

出于打字稿的目的, textStatus errorThrown 是字符串, jqXHR 对象,以及 data 取决于远程服务器发送给你的东西。

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