mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Data: Work around IE11 bug with onpageshow attribute
Fixes #14894
(cherry picked from commit b8133e282c)
Conflicts:
src/data.js
test/unit/data.js
This commit is contained in:
13
src/data.js
13
src/data.js
@@ -287,12 +287,15 @@ jQuery.fn.extend({
|
||||
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
|
||||
i = attrs.length;
|
||||
while ( i-- ) {
|
||||
name = attrs[i].name;
|
||||
|
||||
if ( name.indexOf("data-") === 0 ) {
|
||||
name = jQuery.camelCase( name.slice(5) );
|
||||
|
||||
dataAttr( elem, name, data[ name ] );
|
||||
// Support: IE11+
|
||||
// The attrs elements can be null (#14894)
|
||||
if ( attrs[ i ] ) {
|
||||
name = attrs[ i ].name;
|
||||
if ( name.indexOf( "data-" ) === 0 ) {
|
||||
name = jQuery.camelCase( name.slice(5) );
|
||||
dataAttr( elem, name, data[ name ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
jQuery._data( elem, "parsedAttrs", true );
|
||||
|
||||
Reference in New Issue
Block a user