Active Client Pages: Summary of the Document Phase of Chrys`s Approach
In this part of the series, I give you a summary of the Document Phase of my approach to Active Client Pages. In order to help you better understand this phase, I need to explain two other approaches to ACP. When I finish that, we will proceed to the next phase. It may seem a little complicated (this is, after all the eighth part of a 12-part series), but by the time we're done you'll understand a number of ways to make your pages load faster over a slow Internet connection, even when they're full of images.
Active Client Pages: Summary of the Document Phase of Chrys`s Approach - Introduction to the Window Phase of Chrys’s Approach to ACP (Page 4 of 4 )
The Window Phase of Chrys’s Approach to ACP is similar to the Document Phase. However, instead of having HTML documents loaded within one browser window, you open browser windows as your pages. Each window can have documents from the Document Phase of Chrys’s Approach. (Note: in ACP a window or a document is considered a page). As you can see, this approach can incorporate the document phase of Chrys’s Approach and the Script and Ajax Approaches.
The Main DOM’s Method to Use
The HTML DOM has a window object which has properties and methods to control and open browser windows (of the same browser). One of these methods has the syntax:
open(URL,name,specs,replace)
This is the main method we shall use to open windows. All four parameters of this function are optional. This is the main function (method) we shall use in this series.
If in a JavaScript you type without arguments,
window.open()
a new window will open. Because there are no arguments, the opened window should come with a title bar, a menu bar, a tool bar, an address bar and a links bar. You should see “about:blank” as the title and as the content of the address bar.
The URL Parameter
If you want the new window to be a web page from some server, then type the URL in quotes at this position (in ACP we do not use this).
The name Parameter
This is the name of the window. It is the target attribute.
The specs Parameter
This parameter takes the arguments for some of the presentation (size, position, etc.) aspects of the window. It is a comma-separated list of items. We shall learn more about this.
The replace Parameter
This parameter specifies whether the URL creates a new entry or replaces the current entry in the history list. We shall not use this much.
The Window Box
Remember that all the parameters for the open() function are optional. So if you do not want any argument, you can have an empty string in its place. If you do not want any of the arguments, you can type:
window.open(“”,””,””,””)
The new resulting window should have the same characteristics as if you typed
window.open()
That is, the window will have a title bar, a menu bar, a tool bar, an address bar and a links bar. If you do not want any bar, there is a way of getting rid of it. We shall see how later.
Now, if you want to omit parameters in the above method, then you have to follow these guidelines. If you want to include an argument for the first parameter, then you can omit the other parameters. That is, you can have
window.open(“URL”)
If you want to include an argument for the first and second parameters, then you can omit the next two parameters. That is, you can have
window.open(“URL”, “NAME”)
If you want to include arguments for the first, second and third parameters, then you can omit the last parameter. That is, you can have
window.open(“URL”, “NAME”, “SPECS”)
If you do not want to follow this order, then you need to have empty strings in place of the arguments you do not want to include. For example, if you want only the name, then you should type:
window.open(“”, “NAME”, “”,””)
We take a break here and continue in the next part of the series.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.