tuupola / jquery_chained

Chained Selects for jQuery and Zepto
https://appelsiini.net/projects/chained/
589 stars 283 forks source link

Add extra type cast to String before call split() #76

Open MinhThienDX opened 6 years ago

MinhThienDX commented 6 years ago

Fix bug when call split() on number Similar to this PR https://github.com/tuupola/jquery_chained/pull/74 but he changed the minified version

pduey commented 5 years ago

Instead of calling data("chained") and casting to String, per the jquery docs, we could call attr("data-chained") instead, and instead of coercing strings into numbers, the String type will be preserved.

I've done that on my own branch and it works.

// var data = $(this).data("chained");
var data = $(this).attr("data-chained");