是否可以向先前聲明的對象添加新屬性?下面是一些代碼,以澄清(與uploadify jQuery插件):在uploadify中動態設置屬性
$('#featuredimageupload').uploadify({
'uploader' : base_url + 'media/js/uploadify.swf',
'script': base_url + 'post/uploadflash',
'multi' : true,
'queueID' : 'queue',
'cancelImg' : base_url + '/media/images/cancel.png',
'fileDesc' : 'Allowed Types: (*.jpg,*.png,*.gif)',
'fileExt' : '*.jpg;*.JPG;*.gif;*.GIF;*.png;*.PNG',
'queueSizeLimit' : 9,
'sizeLimit': 1000000,
'method' : 'GET',
'buttonText' : 'Browse',
'onComplete' : function(event, queue, obj, response, data){
if(response =='false'){
alert('Maximum number of images reached!');
$('#uploader').uploadifyClearQueue();
return false;
}
},
'onError' : function(event,queue,file,error){
alert('An error occured. No files were uploaded');
$('#uploader').uploadifyClearQueue();
}
});
然後像做
$('#form').submit(function(){
$('#featuredimageupload').uploadify({scripData : data})
})
我看到這個用的jqGrid做
HTTP:/ /stackoverflow.com/questions/2037605/uploadify-updatesettings-problems/3840684#3840684 這個,真的很好..它適用於我 – Shailesh 2012-06-01 10:33:05