I currently do this to check if one of two elements exists:
if ($(\".element1\").length > 0 || $(\".element2\").length > 0) { //do stuff... }
$.fn.exists = function(ifExists) { return this.length ? ifExists.call(this, this) : this; };
usage:
$('.element1, .element2').exists(function(els) { // this and els refers to $('.element1, .element2') });