markjs / jquery-dependent-selects

A jQuery plugin to allow multi-level select boxes that degrade gracefully.
http://markjs.github.com/jquery-dependent-selects/
MIT License
56 stars 23 forks source link

Throws error in IE8 #8

Closed paulspringett closed 11 years ago

paulspringett commented 11 years ago

Calling .dependentSelects() in IE8 breaks all JS on the page, see http://jsbin.com/isawov/1/ to reproduce

acaron commented 11 years ago

IE8 doesn't support .map() and .trim(). This code will work:

Line 255: Original $newOption.html(splitOptionName($newOption).slice(1).join(options.separator).trim()); New line $newOption.html($.trim(splitOptionName($newOption).slice(1).join(options.separator)));

Line 32 to 34: Original array = $option.text().split(options.separator).map(function(valuePart) { return valuePart.trim(); }); New line array = $.map($option.text().split(options.separator), function(valuePart) { return $.trim(valuePart); });

I will pull a request. Hope it fix your issue!

markjs commented 11 years ago

This has been fixed by @acaron in #10