FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Javascript to launch new window with attributes

 


shenyl
I need to launch new window from within a web page, to provide a separate thread (session) of the application.

But the search on google to some sites are unable to meet my needs.

I need to window.open(), and wish to have full screen (some recommended type= or fullscreen, but don't work), set menubar and toolbar to no, prevent resizable (if possible, like disabling the minimise button), set location=no, dependent=yes (if possible).

Help is much appreciated.
ashok
The syntax of the window.open method is:

Code:
open (URL, windowName[, windowFeatures])


Quote:
URL
The URL of the page to open in the new window. This argument could be blank.

windowName
A name to be given to the new window. The name can be used to refer this window again.

windowFeatures
A string that determines the various window features to be included in the popup window (like status bar, address bar etc)


The following code opens a new browser window with standard features.

Code:
window.open ("http://www.javascript-coder.com","mywindow");


Changing the features of the Popup
You can control the features of the popup using the last argument to the window.open method. The following code opens a window with a status bar and no extra features.
Code:
window.open ("http://www.javascript-coder.com","mywindow","status=1");


The code below opens a window with toolbar and status bar.
Code:
window.open ("http://www.javascript-coder.com",
"mywindow","status=1,toolbar=1");


The following shows the features and the string tokens you can use:
Quote:
status= The status bar at the bottom of the window.
toolbar= The standard browser toolbar, with buttons such as Back and Forward.
location= The Location entry field where you enter the URL.
menubar= The menu bar of the window
directories= The standard browser directory buttons, such as What's New and What's Cool
resizable= Allow/Disallow the user to resize the window.
scrollbars= Enable the scrollbars if the document is bigger than the window
height= Specifies the height of the window in pixels. (example: height='350')
width= Specifies the width of the window in pixels.


Except width and height which are pixel values, All other values are either 0 or 1, 0 for Off, 1 for On.

Hope this helps! For more help, Google's always there... Cool
shenyl
Thanks for the detailed features.

It is indeed a good summary for these features.

However, I do need a pop-up that is FULL SCREEN, which is not addressed in the features.

I did tried Google, and several sites has given some suggestions, but they did not work.

Hello ashok, care to help out in this full screen mode?

By the way, you can also use =no (same as =0) and =yes (same as =1), which normally makes the selected values easier to understand.

Thanks and if you care to help out on full screen feature, I will be very thankful.
Reply to topic    Frihost Forum Index -> Computers -> Computer Problems and Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.