IE doesn't like doing attaching the mergeNum property to XML documents, so for now, we're just going to (possibly) return duplicates in IE, in XML documents. (bug #1357).

This commit is contained in:
John Resig 2007-07-20 18:08:29 +00:00
parent eb5529eac0
commit 3604d14896

14
src/jquery/jquery.js vendored
View file

@ -1666,11 +1666,15 @@ jQuery.extend({
unique: function(first) {
var r = [], num = jQuery.mergeNum++;
for ( var i = 0, fl = first.length; i < fl; i++ )
if ( num != first[i].mergeNum ) {
first[i].mergeNum = num;
r.push(first[i]);
}
try {
for ( var i = 0, fl = first.length; i < fl; i++ )
if ( num != first[i].mergeNum ) {
first[i].mergeNum = num;
r.push(first[i]);
}
} catch(e) {
r = first;
}
return r;
},