Catching Frame Events

By David Wall, ITworld |  How-to

Frames, like form elements and windows, have event handlers. A frame's
event handlers (onLoad, onUnload, onFocus and onBlur) can make your
program wait until some critical event takes place in a frame, before
executing an event.

Using the onFocus event handler, which is activated when you click in a
particular frame, this exercise illustrates frame event handlers.

FrameEH.html


Frame Event Handlers







Left.html


A Demonstration of HTML Frames








Right.html

From this example, you see that frames' event handlers go in the
tag, like this:

That event handler tells the JavaScript interpreter to launch an alert
window anytime that one of the frames in the frameset gets the focus.
In practice, anytime you click on one of framesets, an alert window
launches so the real-world utility of this program is limited.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

ITworld Answers helps you solve problems and share expertise. Ask a question or take a crack at answering the new questions below.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question
randomness