Skip to main content

Bug Tracker

Side navigation

#13718 closed bug (cantfix)

Opened April 03, 2013 10:40AM UTC

Closed April 05, 2013 12:24PM UTC

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

Reported by: sergeytsaplin@gmail.com Owned by: sergeytsaplin@gmail.com
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

Attachments (0)
Change History (4)

Changed April 03, 2013 11:10AM UTC by sergeytsaplin@gmail.com comment:1

More simplier example on jsfiddle:

http://jsfiddle.net/8f2rN/

also don't work in IE7

Changed April 04, 2013 07:35PM UTC by dmethvin comment:2

owner: → sergeytsaplin@gmail.com
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?

Changed April 05, 2013 04:57AM UTC by sergeytsaplin@gmail.com comment:3

status: pendingnew

Replying to [comment:2 dmethvin]:

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

Yes it works. Thank you!

Changed April 05, 2013 12:24PM UTC by dmethvin comment:4

resolution: → cantfix
status: newclosed

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