[thelist] How do I tell when a frame is loaded?

Lee kowalkowski lee.kowalkowski at googlemail.com
Wed Aug 2 05:22:42 CDT 2006


On 01/08/06, Rob <sendrobstuff at gmail.com> wrote:
> I've got a frameset with Javascript in one frame that loads a series
> of URLs into a second frame. I want to extract some information from
> the page in this second frame.
>
> Given these pages to load are not all from the same domain (and I
> can't put any JS into them) how do I tell when the page has finished
> loading in the second frame (and henceforth, therewith, I can start to
> extract the stuff I want)?

You will not be able to extract information from any page that is not
in the same domain as your frameset.  You'll get a permission denied
error.

If you're only going to use this only on local Windows computers
though, you can create an HTML Application (basically, rename your
.HTML file to .HTA), which will allow cross-domain frame scripting
(via the frame element's contentWindow object).

If you are going to do all that - you can tell when the second frame
has loaded with an onload attribute on the second frame element.  Hey,
why not even pass this.contentWindow as an argument?

-- 
LK



More information about the thelist mailing list