I am working on a downloader script and need to load html, get required elements and act accordingly. My probelm is onload for an iFrame is executing too early, and the html is emtpy. As I understand it, this is the way onload is supposed to act and the usual solution is to put an onload statement on the target page, but I don't have any control over the target URL. So I also tried a setTimeout(parseHTL_function_here). But the same thing happens, empty html, it seems the setTimeout also prevents html loading in background. If I put an alert just inside the parseHTL_function and wait a few seconds before clicking ok , the script works, html intact.
So the basic question is: How can I wait until an iFrame's content is fully loaded before acting on it?
I don't have control over the document going into the iFrame, it's not my doc. Unless I can add it after it is loaded in the iFrame? Is that possible?
like kor said, if the doc is on another server, it's out of your reach.