It would be nice to have a function to test for JQuery equality.
I've made a .equals function which does the equality checks just like
many other languages:
/**
* Returns true when the two jQuery objects have the same objects
selected
* in the same order, false otherwise.
*/
$.fn.equals = function(other) {
if (this.length!=other.length) {
return false;
}
var result = true;
this.each(function(i){
if (this!=other[i]) {
result = false;
// break each loop
return false;
}
});
return result;
};
Maybe this could make it to the JQuery core someday?
grtz,
Rick
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---