jquery_chained icon indicating copy to clipboard operation
jquery_chained copied to clipboard

Add extra type cast to String before call split()

Open MinhThienDX opened this issue 6 years ago • 1 comments

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

MinhThienDX avatar Aug 19 '18 04:08 MinhThienDX

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");

pduey avatar Sep 18 '19 14:09 pduey