How to find the most parent body element of a document, if you're using a lot of frames. Inside a iframe that also is in a few iframes, I want to call a function for the most upper document body.
The following works, except that you have to count for the parents each time.
$(parent.parent.parent.parent.document.body).function('loading');
Isn't there something like this?;
$(parentOfAllParents.document.body).function('loading');