Forum Moderators: open

Message Too Old, No Replies

window.onload event in iframe

window.onload iframe

         

jackhammerUK

6:26 pm on Dec 2, 2003 (gmt 0)

10+ Year Member



I have a page containing 3 iframes (iframe_top, iframe_main, iframe_left).

From an option in iframe_top I load a page into iframe_main. I now want an onload event on that page to open another page in iframe_left.

Any ideas?

Purple Martin

1:32 am on Dec 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the HTML of the page that gets loaded in iframe_main you can use the usual onLoad event in the body tag to call a JavaScript function:

<body onLoad="loadLeftFrame()">

Now write a JavaScript function loadLeftFrame() to load a new page into the left frame (you'll probably be able to copy-n-paste-n-edit the code called by the option in iframe_top to do this).

HTH

jackhammerUK

11:44 am on Dec 3, 2003 (gmt 0)

10+ Year Member



Thanks alot, it works... I am no programmer, so sorry for the lame question :)