EastDane
EastDane

Reputation: 137

jQuery unique not working

I've used $.unique before, but this timne, I can't get it to work.

http://jsfiddle.net/tNXZt/

I get an array of objects, but it does not seem to do anything with them. I hope you can help me here.

Thanks

Upvotes: 0

Views: 1333

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117364

$.unique removes duplicates of a node, but there are not duplicate nodes inside the array, there are 3 different nodes. 2 nodes are not unique when they consist of the same markup, they must be the same DOMNode

for example here you would have duplicates:

[$(".test").get(0),
 $(".test").get(0)] 

Upvotes: 2

Related Questions