Use of Frame in IE DOM

xiaoxiao2021-03-06  76

First, what is a framework?

Frames Frames The most important function is "Split" window, so that each "small window" can display different HTML files, and interact between different frames (Interact), this means that messages and information can be exchanged between different frameworks. For example: Suppose you open two frames, the first Frame can display book directory, the second frame, the specific content framework of the chapter can split the screen into a different area, each area has its own URL, through Frames [] Array objects to achieve access to different frameworks. In fact, the frame object itself also has a class window, which inherits all features of the window object and has all properties and methods.

The above HTML ID divides the screen into three frames. First divide the window into a window of two behavior, then divide it into two windows. And put your own HTML document in the corresponding framework.

Tell the browser via [FRAMSET] You have to set a few frames; ROWS This parameter tells the browser to split the window into a few columns; the parameters of the cols are telling the browser. You want to divide the window into a few lines.

You can divide the window more complicated with many groups of tags.

You can give each frame a "name" (NAME). The status of Frame is very important in the JavaScript syntax.

You can use to tell your browser which HTML file you want to load.

Second, how to access the framework

In the previous item, we introduced access to different elements in a single form using Document.Forms []. To implement access to different elements of multi-form in the framework, you must use the frames attribute in the Window object. Frames properties are also an array, and he has one of the parent frameworks for each sub-frame. Access to different frameworks through the subscript:

Parent.frames [index1] .docuement.forms [index2]

Determine the number of forms in the window via Parent.frames.Length.

In addition to using array subscripts to access the form, you can use the frame name and the form name to implement the interviews of each element:

Parent.framesname.Decument.formnames.efficientname. (m / p)

Third, example

Below we will use the JavaScript script to implement more complex information interaction in the Web. This example is a dynamic interaction of form information in a multi-window, first in the program to create three windows for the form interaction in the browser window, each form of dynamic interaction of different information.

Tset9.html For the main call document, it first divides the window into a two-line form, and then divides the form of the second row in the form of two columns;

Test9-1.html is the display title document; Test9_2.html is the second framework document, which is to be noted here that "Yunnan Province" and "Sichuan Province" shown by JavaScript script are changed to "Kunming" and "Chengdu City "; TEST7_3.HTML is the third framework document.

The main role of the main adjustment is to divide the window into a multi-line form, and then the form of the second row is divided into a list of two rows. TEST9.HTM

The main role of the first frame is to display the title document. TEST9_1.HTM

Using Frames to Implement Web Interaction

The second framework main role is to implement interaction. It can be changed to "Kunming" and "Chengdu" in "Yunnan Province" and "Sichuan Province" as shown by JavaScript scripts. TEST9_2.HTM

Please select the city: