Exp11 2
Exp11 2
Exp11 2
2
Aim: Develop a Web page for working with child window.
Theory:
A child window is created using frames in a web page.
Creating frame:
Frames are used to divide browser window into multiple sections where each section is treated as window
that can have independent contents. A frame can load separate HTML document in each frame in a window.
<frameset> tag : A frameset is defined as a set of frames inserted in an HTML web page. These frames
can be in the form of rows and columns in different size. Frameset tells the browser how to divide the screen
into multiple areas.
<frameset> ... </frameset>
Attributes:
<frame> tag : Frame tag is used to insert web page content in a frame. It is an empty tag.
Attributes:
JavaScript refers to the frameset as the top or the parent. The parent frame is always on top of the display.
The other frames inside the frameset are referred as child frames. Child windows always appear within the
parent window and can have unique name to be used in an application.
Programs:
Example: - A window divided into two rows:
Code: Output:
<html>
<frameset rows="25%,75%" frameborder="Yes"
bordercolor="red">
<frame src="page1.html" name="f1">
<frame src="page2.html" name="f2"> </frameset>
</html>
Write code to design your own framed web page with atleast three frames for any
application.
2. Write statement to make frame border invisible when a web page is loaded in the browser.
Ans.
3. Write code to change content of a child window using location property of window.
Ans.
4. Write code to change text on button in frame1 when clicked on ‘change’ button in frame 2.
Ans.
Conclusion: With all the concepts based on working with child window , successfully executed all
programs with correct output.