Core: Use charAt instead of array notation on strings, to support IE8(?)

Closes #1067
This commit is contained in:
NetImperia
2014-04-02 02:19:42 -07:00
committed by Jörn Zaefferer
parent 4a3c23dcbe
commit 69e1c5f1d3

View File

@@ -617,7 +617,7 @@ $.extend($.validator, {
// specified in the element's HTML5 data attribute
// return the generic message if present and no method specific message is present
customDataMessage: function( element, method ) {
return $( element ).data( "msg" + method[ 0 ].toUpperCase() +
return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() +
method.substring( 1 ).toLowerCase() ) || $( element ).data("msg");
},
@@ -922,7 +922,7 @@ $.extend($.validator, {
var method, value,
rules = {}, $element = $( element );
for ( method in $.validator.methods ) {
value = $element.data( "rule" + method[ 0 ].toUpperCase() + method.substring( 1 ).toLowerCase() );
value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );
if ( value !== undefined ) {
rules[ method ] = value;
}