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

7. Managing Multiple Frames > 7.2. Changing the Content of One Frame from Anoth...

Changing the Content of One Frame from Another

NN 2, IE 3

Problem

You want a script in one frame to change the document in another frame.

Solution

Assign the URL to the location.href property of the sibling frame with the following syntax:

parent.otherFrameName.location.href = "newPage.html";

Replace otherFrameName with the name assigned to the name attribute of the <frame> tag designated for that other frame in the framesetting document.

Discussion

You don’t need JavaScript at all to load a page into another frame if the user is clicking on a hyperlink. Instead, assign the frame’s name to the target attribute of the <a> tag, and let the href assignment handle the navigation part:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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