jQuery-Plugins
jQuery-Plugins copied to clipboard
Plugin (populating selectbox) iterates trough not own array properties
Hi
I've used this plugin on a site where I've prototyped Array object: "Array.prototype.maxNum = function () {...}"
I've noticed that this property has been included in my select box when this plugin fired.
To avoid this problem, this (line no. 111 in jquery.selectboxes.js):
------------------- CODE ---------------------
for(var item in items) { add(this, item, items[item], sO, startindex); startindex += 1; }
should have additional check if it is own property:
------------------- CODE ---------------------
for(var item in items) { if (items.hasOwnProperty(item)) { add(this, item, items[item], sO, startindex); startindex += 1; } }
Regards, Marcin Gosz [email protected]