I am trying to check if a fancybox has been loaded already. If so then I run an ajax script to put content inside.
If not I open a fancybox iframe and it fetches content
This should work without testing for .length
.length
if ($('div#fancybox-frame:empty'))
However, :empty does check for text nodes. So if you div has a line break, i.e.,
:empty
div
it might choke. In that case, place the opening and closing tags on the same line.