in this script which you use, the problem is most likely in these lines of code:
for (var i in parts) {
name += "[\"" + $.dynamicDropdown.escapeQuotes(parts[i]) + "\"]";
...
}
The point is, do not iterate over an array using for in
loop, since there is probably a function added to the Array.prototype
which shows up in for in
loop over the array, simply change it to:
for (var i=0;i<parts.length;i++) {
name += "[\"" + $.dynamicDropdown.escapeQuotes(parts[i]) + "\"]";
...
}
then this won't cacth that function any more.
as you added to your post, the reason is exactly what I have pointed out. but if you still insist on using for in
loop, you should check the type of parts[i]
like this:
for (var i in parts) {
if(typeof parts[i] != "string") continue;
name += "[\"" + $.dynamicDropdown.escapeQuotes(parts[i]) + "\"]";
...
}
you have the same problem with another for in
loop:
for (var i in options) {
option = $(document.createElement("option"))
.val($.isArray(options[i]) ? i : options[i])
.html(i)
.appendTo(select);
}
change it to for (var i=0;i<options.length;i++)
or add this:
if(typeof options[i] != "string") continue;
to the first line of your for loop.