Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Browsers
Expertise: Beginner
Nov 3, 1999

Dynamically Load a Page From a Frame Into Another

Question:

Is there a way I can load a Web page from the top frame into the bottom frame, when a user clicks on a link in the bottom frame? The page should be dynamic as to load whatever page is loaded in the top frame.

Answer:

You can change the content of a frame at any time, by referencing the name of the frame from the parent (the parenting window). If you create a frame page as follows:

 
  You must use a browser that can display frames 
  to see this page. 
   
   
     
     
   
 

You can use a function similar to the following to change frame contents of toptoc:

function test() {
  parent.toptoc.location.href="someother.htm";
}

You can skip the "href" reference. To assign the contents of one frame to another, you can do something like:

parent.toptoc.location.href=parent.other.location.href;
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap