The "window.open" command has a lot of features that can be turned off or on, or otherwise controlled. For more info, go to: WebReference
|
Page 4
First a confession ... I didn't give you the entire syntax for the "window.open" command!
Here is an expanded version of the syntax:
window.open(sURL, sName, sFeatures);
where:
sURL is a string that specifies the URL of the document to display. If no URL is specified, a new, empty window is created.
sName is a string that specifies the name of the window. This name is used as the value for the TARGET attribute of a <FORM> or <A> tag.
sFeatures is a string that contains a list of other options in a comma-separated format.
|
Let me show you three examples, and it should make sense:
window.open('http://www.trellix.com','myWindow','menubar=1,resizable=1,scrollbars=1');
window.open('http://www.trellix.com','myWindow','menubar,scrollbars');
window.open('http://www.trellix.com','myWindow','resizable=1,height=200,width=300');
|
Take a look at the syntax of the first example. Each feature and corresponding value is separated by a comma, and then the whole set of features is surrounded by a single pair of quote marks.
The syntax for each specific feature is: feature[=value] ... where a value of 1 means turn the option on; and a value of 0 means turn the option off
But as you can see in the second example, the value is not even required. If a feature is listed, you are indicating to turn that feature on. Features that are not listed are turned off.
So in the second example, we are turning on menubars and scrollbars.
But since resizable is not listed, it will be turned off!
Let's go to the next page to talk see the third example in action ... Next page>
|