Assuming that all the frames are on the same domain, I need to start at a given node (or document), and search for an element with a given ID. If it’s not found in the current document, I need to recursively (breadth-first) search all descendent iframes.
Unless I’m missing some gotcha, I’m sure I could write this function, but I’m sure someone’s already done it.
I don’t use jQuery in my app, so although that’s fine to mention for other SO readers, it won’t help me. I do, however, use Prototype, and it can be assumed that all descendent iframes will have prototype included.
Any advice?
I think you can get it recursively like this:
and call it like this:
here is jsFiddler link: http://jsfiddle.net/QxL7z/2/