Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14784 closed bug (notabug)

$.merge does not work in IE8 as it does in IE9

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


I'm using $.merge to merge two set of rows together, however the same code doesn't work in IE8, but it does in IE9. The following code doesn't get to the fourth line.

1.	var rowHeaders = $(".tblRowHeaders")[0].rows;
2.	var rowData = $(".tblData")[0].rows;
3.	var all = $.merge(rowData,rowHeaders);
4.	alert('works');

You can work around it by doing changing the 3th line to

3.	var all = $.merge($(rowData),$(rowHeaders));

I believe this to be a bug, but it may be that the original usage isn't legitimate.

Change History (2)

comment:1 Changed 9 years ago by rvidal

Could you provide a test case?

comment:2 Changed 9 years ago by gibson042

Resolution: notabug
Status: newclosed

From http://api.jquery.com/jQuery.merge/:

The $.merge() function is destructive. It alters the first parameter to add the items from the second.

The first argument to jQuery.merge must be mutable (unlike the rows HTMLCollection from your example). Even though IE9 doesn't generate an exception, the operation isn't successful: http://jsbin.com/tosep/1

Note: See TracTickets for help on using tickets.