I don't see that being useful enough to be in the core either. On a side note, if you saved a jQ object in a var and want to check if another var is a copy of it, you can use $.data( obj1 ) == $.data ( obj2 ) to compare their unique IDs.
On Apr 18, 12:21 am, Matt Kruse <[email protected]> wrote: > On Apr 17, 2:21 am, Rick <[email protected]> wrote: > > > It would be nice to have a function to test for JQuery equality. > > As previous discussed > here:http://groups.google.com/group/jquery-en/browse_thread/thread/002d754... > > This is a bit cleaner and uses !== which is better than != > > $.fn.equals = function(compareTo) { > if (!compareTo || !compareTo.length || this.length! > =compareTo.length) { > return false; > } > for (var i=0; i<this.length; i++) { > if (this[i]!==compareTo[i]) { > return false; > } > } > return true; > > } > > I'm still not quite sure why this would be useful. > > Matt Kruse --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---
