Implement more complex interactions with JavaScript

Source: Internet
Author: User
Tags split

First, what is the framework

The main function of frame frames is "split" window, so that each "small window" can display different htm l files, different frameworks can interact (interact), which means that different frameworks can exchange information and data. For example, suppose you open two frames, the first frame displays the catalog of the book, and the second frame displays the contents of the chapter.

The framework can split the screen into different regions, each with its own URL, to achieve access to different frameworks through the frames[] array object. In fact, the frame object itself is a kind of window that inherits all the characteristics of the Window object and owns all the properties and methods. Let's take a look at the example of the framework first. See Figure 9-1 below.

Figure 9-1 Frame Objects

<HTML>
<HEAD>
</HEAD>
<Frameset Rows="20%,80%">
<frame src="test9_1.html">
<Frameset Cols="50%,50%">
<frame src="test9_2.html">
<frame src="test9_3.html">
</Frameset>
</Frameset>
</HTML>

The above HTML logo divides the screen into three frames. The window is divided into two behavior units and then divided into two windows. and put your own HTML document in the appropriate frame.

Tell the browser by [Framset] that you want to set up several frames; rows This parameter tells the browser that you want to split the window into columns, and cols This argument tells the browser that you want to split the window into rows.

You can use many groups of <frameset...> tags to split the window more complex.

You can give each frame a "first name" (name). The name of the frame is important in JavaScript syntax. You can use <src> to tell the browser which HTML file you want to load.

Ii. How to access the framework

We have previously described using document.forms[to implement access to different elements of a single form. To implement access to different elements of multiple forms in a frame, you must use the Frames property in the Window object. The Frames property is also an array, and he has one item for each child frame in the parent frameset. Access to different frameworks through subscript:

PARENT.FRAMES[INDEX1].DOCUEMENT.FORMS[INDEX2]

Determine the number of forms in the window by Parent.frames.length. In addition to using an array subscript to access a form, you can also use the frame name and form name to achieve an interview for each element:

Parent.framesName.decument.formNames.elementName. (m/p)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.