I declared a array variable els = []; in which I want to store jquery elments which are created at some point within certain events:
els[file.id] = $('<li></li>');
$('body').append(els[file.id]);
file.id is a unique id generated by the plupload script which I’m using (the event is from it)
But it doesnt work, the array is always empty…
Arrays can only have sequential, numeric keys. You can’t choose arbitrary keys. To use arbitrary key-value pairs, use an object:
With that said, the code you’ve written should still work (even though
els.lengthwould be 0) – perhaps this isn’t a complete code sample?