I’m usinag plugin Fileuploader. I have a trouble how to change on of his attribute (Class). Id must be the same as $('#jquery-wrapped-fine-uploader')‘s attr Id (i.e. <div id="jquery-wrapped-fine-uploader" class="main_pic">). Is there a way how to get this value?
$('#jquery-wrapped-fine-uploader').fineUploader({
request: {
endpoint: '../../main/fileupload',
params: {
'class' : (function(){
var class = 5;
/* Заместо 5 надо поставить атрибут class */
/* i.e. insert here an Class attr */
/* $(this).closest('#jquery-wrapped-fine-uploader').attr('class')
does not work :-(
*/
return id;
})(),
}
},
failedUploadTextDisplay: {
mode: 'custom',
maxChars: 256,
responseProperty: 'error',
enableTooltip: true
},
debug: true,
});
})
It must be work –
.attr('class').The problem is –
$(this).closest('#jquery-wrapped-fine-uploader').attr('class').What does ‘this’ mean in this context? If it’s
'#jquery-wrapped-fine-uploader'you must write$(this).attr('class').Try to use something like this:
P.S. Короче если по русски – то не понятно что объект “this”. Поэтому попробуй код который написан выше. Правда не гарантирую что он без ошибок.