What is the best way to detect if a jQuery-selector returns an empty object. If you do:
alert($(\'#notAnElement\'));
you get [object Object
This is in the JQuery documentation:
http://learn.jquery.com/using-jquery-core/faq/how-do-i-test-whether-an-element-exists/
alert( $( "#notAnElement" ).length ? 'Not null' : 'Null' );