我的代码返回错误TypeError:当我在done()方法中调用以下方法时,e未定义:
replaceContent : function(data) {
var defer = $.Deferred();
if (data.replaceContent === '' || typeof data.replaceContent === 'undefined') {
defer.resolve(data);
}
var thisIndex = 0;
$.each(data.replaceContent, function(k, v) {
$(k).html(v);
++thisIndex;
if (thisIndex === data.replaceContent.length) {
defer.resolve(data);
}
});
return defer.promise();
}
知道为什么吗?