Using JavaScript framework
When talking about the window object, we mentioned that a web page within a frame is also a window object, that is to say, the Frame object is also a window object. In the most understandable terms, each HTML file occupies a window object, including the web page that defines the frame ("frame web page"). In IE, the frame inserted in the document using the "
window.frames[x] window.frames['frameName'] window.frameName
Where, x refers to the frame specified in the window object. Like other arrays, x also starts from zero. frameName refers to the name of the frame, which is the same as the "name" attribute in .
If the window object specified using window.frameName is also a frame web page, then the method of referencing its frame: window.frameName.subFrameName. And so on.
It should be noted that no matter where the "window" object is referenced, what is returned is the "current" window object. If you want to access other window objects, you need to use the parent and top attributes. parent refers to the "parent" window object, which is the frame web page containing the current window object; top refers to the window object at the top of the window.
When using frameworks, you also need to pay close attention to the global variables and custom functions defined in your JavaScript. They all belong to the window object they belong to. To reference global variables or custom functions in other frameworks, you have to use the annoying method of "Window object.Frame object [.Frame object...].Global variables or custom functions".
The above problem is often ignored when establishing a connection: if a default target window is defined in