• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

7. Managing Multiple Frames > 7.3. Changing the Content of Multiple Frames at O...

Changing the Content of Multiple Frames at Once

NN 2, IE 3

Problem

You want a single button or hyperlink to change the content of two or more frames of the frameset.

Solution

Scripting is required for two frame changes at once. It is best to define a generalized function that performs the navigation, and invoke that function from an onclick event handler of a button or hyperlink. A function format that works for both interface elements is like the following:

function loadFrames(url1, url2) {
    parent.otherFrameName.location.href = url1;
    location.href = url2;
    return false;
}

The hyperlink tag that invokes this function looks as follows:

<a href="content12.html" target="content" onclick="return 
loadFrames('content12.html', 'navbar12.html')">...</a>

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint