Complex javascript window frame sharding _ javascript skills

Source: Internet
Author: User
This article mainly explains in detail the complex javascript window sharding, what is the relationship between window sharding and frame windows in JavaScript. For more information, see What is window frame separation?

Window Frame separation separates a browser document window into multiple windows. Each window can display an independent webpage file, and each frame (that is, the page) has its own url.

How do I create a frame window?

Frames are usually composed

  Align:Set the position of the split window to left, right, center, top, or bottom ).

  Name:Specifies the name of the window Shard, and src specifies the HTML page address corresponding to the window shard.

  Noresize:For the user, whenWhen this parameter is included in the tag, you cannot use the mouse to adjust the size of each window.

  Scrolling:Set whether to use a scroll bar in the window. Do not set a scroll bar when scrolling is set to no. If scrolling is set to yes, the scroll bar is required. If scrolling is set to auoto, the scroll bar is automatically set based on the actual situation.

  Frameborder and bordercolor:Is to set whether there is a border and border color of the window. But the object is only usedThe marked window.

  Marginheight and marginwidth:It is used to set the width of the upper and lower edges and the left and right edges of the window.

For example:

   

What is the relationship between frame windows in JavaScript?
Any frame of a window can be passed throughTop, framesAndParentAttribute to reference other frames.

JavaScript code in any window or frame can reference its own window or frame as window or self.

Each window has the frames attribute. This attribute references an array of Window objects. Each element represents the frames contained in the Window. (If a Window does not have any frames, the frames [] array is empty, frames. length is 0 ). in this way, the window can use frames [0] to reference its first frame, use frames [1] to reference the second frame, and so on.

Each Window also contains a parent attribute, which references the Window object containing the Window. In this way, the first frame in the window can reference its sibling frame, namely:

 parent.frames[1]

If a window is a top-level window, rather than a frame, the parent attribute references the window itself:

parent==self;

If a frame is included in another frame, and the latter is included in the top-level window, the frame can use parent. parent to reference the top-level window.

Note:
Frames cannot coexist with the body tag and content body.

Frame splitting is not conducive to search engine optimization. Frame splitting is not recommended for normal front-end pages.

The above is all the content of this article, and I hope it will help you learn javascript programming.

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.