JavaScript tutorial - from getting started to master (Nine)

xiaoxiao2021-03-06  20

JavaScript Tutorial - From Getting Started to Wen (9) Realizing more complex interaction with JavaScript, what is the most important function of frame frame frames Frames is "split" window, so that each "small window" can display different HTM L files, different The framework can be interacted (Interact), which means that information and information can be exchanged between different frameworks. For example: assuming that you have opened two frames, the first Frame can display the directory of the book, and the second frame shows the specific content of the chapter. The frame can split the screen into a different area, each area has its own URL, and access to different frameworks through the frames [] array object. 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. Let's take a look at the example of the framework. See Figure 9-1. Figure 9-1 Frame Object

The above HTML identifier 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 front, we introduce 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 by subscript: Parent.frames [index1] .docuement.forms [index2] determines the number of forms in the window via Parent.frames.Length. In addition to using the array subscript 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.ElementName. (M / p) Third, the following we pass a specific instance It is to make more complex information interactions in the Web using JavaScript scripts. 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 a parallel form; Test9-1.html is a display title document; test9_2. HTML is the second framework document. It is to note that "Yunnan Province" and "Sichuan" shown by JavaScript script are changed to "Kunming" and "Chengdu"; 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 framework is to display title documentation. Test9_1.htm

Using the framework Implementation Web Interaction The main role of the second framework 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: