Topic: The custom example
If one relies on the code in the custom example one could get into trouble in cases where one has extended the js Array like this:
Array.prototype.blub = function() {
return something;
}The trouble comes because in the custom example code we iterate over all the array properties and blub is part of it, so blub will be another "i in files"
So with 2 files we would get a html result like this
file_1.jpg (211 KB)
file_2.jpg (311 KB)
(N/A)So instead of:
for (var i in files) {It should be:
var i, len;
for (i = 0, len = files.length ; i < len; i++) {
$('filelist').innerHTML += '<div id="' + files[i].id + ...
}Seeing this now, you'll say it's obvious of course, but if you want to get started and everything is new you might fail to see this at first.
Last edited by sewo (2012-07-19 09:27:29)