I'm setting up an application that involves blog posts with comments boxes appended to the div that contains the posts. The comments boxes are in iframes and load an html file on the same domain. There are multiple posts/boxes on each page.
I need a javascript that will only run the append script when the posts are written and appear on the page. So in non js language, I'm looking for this:

if div id post#5 appears on the page, show the iframe that contains the comments box that goes with post number 5. else don't show it.

I know it would be easier to use php/server side scripting but that's not an option in this case. I don't know enough javascript to figure this out so if anyone could point me in the right direction, I'd be grateful.