我使用以下AJAX效用函数提出要求
function ajaxHandler(url, data)
{
return new Promise(function (resolve, reject) {
$.ajax({
type: 'POST',
url: url,
dataType: 'json',
data: data,
success: function (data) {
resolve(data);
},
error: function (xhr, textStatus, error) {
reject(error);
},
});
})
}
默认设置的伟大工程的大部分时间,但也有相当多的情况下,在那里我想通过其他参数,如processData
和contentType
。如何通过processData
和contentType
这种情况?
我在代码中看不到'processData'变量。另外'选项'不被使用。 – MaxZoom
如此扩展一个对象, – epascarello
你有一个'选项'对象,但你没有使用它? – axlj