is it possible to add a new property to a previously declared object? Here is some code to clarify (with the uploadify jquery plugin):
$(\'#featuredimageuplo
I believe what you are looking for is this:
$("#form").submit(function(){
var $upload = $("#featuredimageupload");
$upload.uploadifySettings('scriptData', { key : value });
$upload.uploadifyUpload(); // Triggers the upload to start.
});
You can also get the current value by leaving the second parameter off:
var currentSetting = $upload.uploadifySettings('scriptData');
Yes it is possible to add properties (dynamic or otherwise) to an existing Javascript object). You can just use the []
operator to add a dynamic property to an object. For example:
var key = 'foo';
var obj = {param: 'value'};
obj[key] = 'bar';
alert(obj.foo); // bar