Home >Web Front-end >JS Tutorial >Example analysis of FRAME operation problems in JS_javascript skills
The example in this article discusses the operation of FRAME in JS and is shared with everyone for your reference. The specific analysis is as follows:
The above picture is an example. Here, the mutual operations between frames are simply listed as follows: 1. Variables 2. Methods 3. Mutual acquisition of elements between pages.
1. First start from parent(frameABC)------->child(frameA,frameB,frameC)
① Access variable name name
If you operate in frameABC, then you can:
or
or
② Access method func
If you operate in frameABC, then you can:
If you operate in frameABC, then you can:
① Access the parent page variable name. If you operate in frameA (subpage), you can:
Summary:
Frame is just a page frame. If you want to operate the elements in the subframe, you need to enter the window or contentWindow first. To access the parent page from a child page, you need to calculate the parent-child relationship and divide it into several layers.
I read other posts online about page loading issues. It probably means that operating elements before the sub-frame page is loaded will cause bugs. Interested friends can test it in a targeted way, and I believe there will be new gains!
I hope this article will be helpful to everyone’s JavaScript programming design.