Given an element like this <a data-test="10E6"> jQuery interprets the value as an integer in scientific notaion rather than a string as intended when I do elem.data('test')
Given that this is happening in a fairly large application I'm exploring my options for changing this behavior without having to switch to using elem.attr('data-test') everywhere that this may happen.
Since jQuery uses $.isNaN internally before trying to parse the value as a float I could override isNaN adding the regex ^[E\d]+$ like so:
$.isNaN = function( obj ) {
return obj == null || !$.rdigit.test( obj ) || /E/.test( obj ) || isNaN( obj );
}
or override the much more complex $.data
Does anyone have a better plan?