Bug Tracker

Opened 10 years ago

Closed 10 years ago

#13718 closed bug (cantfix)

jQuery 1.8 craching on .removeAttr('rowspan') in IE7 (or IE9 in ie7 mode)

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:

Description

this code calls js error in IE7

var parentCell = $(this).parent(); //this - is a anchor(<a>) element in table cell (<td>) element necessary
parentCell.removeAttr('rowspan');

jquery crushing code:

// Use this for any attribute in IE6/7
// This fixes almost every IE6/7 issue
nodeHook = jQuery.valHooks.button = {
	get: function( elem, name ) {
		var ret;
		ret = elem.getAttributeNode( name );
		return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ?
			ret.value :
			undefined;
	},
	set: function( elem, value, name ) {
		// Set the existing or create a new attribute node
		var ret = elem.getAttributeNode( name );
		if ( !ret ) {
			ret = document.createAttribute( name );
			elem.setAttributeNode( ret );
		}
		return ( ret.value = value + "" ); // !!! crashed here. ret.value = 40, value = ""
	}
};

stack trace:

removeAttr
each
jQuery.each
jQuery.removeAttr
jQuery.attr
nodeHook.set

Change History (4)

comment:1 Changed 10 years ago by [email protected]

More simplier example on jsfiddle: http://jsfiddle.net/8f2rN/

also don't work in IE7

comment:2 Changed 10 years ago by dmethvin

Owner: set to [email protected]
Status: newpending

I can't get jsfiddle to run at all with IE7, or with IE10 in IE7 CV.

As a workaround I would suggest setting the attribute to "1", does that work?

comment:3 in reply to:  2 Changed 10 years ago by [email protected]

Status: pendingnew

Replying to dmethvin:

As a workaround I would suggest setting the attribute to "1", does that work?

Yes it works. Thank you!

comment:4 Changed 10 years ago by dmethvin

Resolution: cantfix
Status: newclosed

Since there's a reasonable workaround I'll close this.

Note: See TracTickets for help on using tickets.