Вопрос по JS
Уважаемые знатоки. В движке есть user.js в котором есть следующий код:
Внимание вопрос: почему у ajaxSubmit так много параметров хотя должен быть только один да и тот объект?
this.uploadAvatar = function(form,input) {
if (!form && input) {
var form = $('<form method="post" enctype="multipart/form-data"></form>').css({
'display': 'none'
}).appendTo('body');
var clone=input.clone(true);
input.hide();
clone.insertAfter(input);
input.appendTo(form);
}
ls.ajaxSubmit(aRouter['settings']+'profile/upload-avatar/',form,function(data){
if (data.bStateError) {
ls.msg.error(data.sMsgTitle,data.sMsg);
} else {
this.showResizeAvatar(data.sTmpFile);
}
}.bind(this));
};
Внимание вопрос: почему у ajaxSubmit так много параметров хотя должен быть только один да и тот объект?