Javascripts > Javascript Windows > WinOpen
Script Title: WinOpen
Description: Opens a new browser with the specified width, height and windows features (e.g. toolbar, menu bar, scrollbar and location bar). Useful wrapper script over the window.open() method.
Example: Available Java-scripts.net
Copy the following code into your <HEAD></HEAD> tags.<script language="JavaScript"> <!-- // Copyright information must stay intact // WinOpen v1.0 // Copyright NavSurf.com 2002, all rights reserved // For more scripts, visit NavSurf.com at http://navsurf.com // Set the input argument to true to enable the window feature function winOpen(URL, windowName, width, height, resizable, location, menubar, scrollbars, status, toolbar){ var windowFeatures; windowFeatures = ''; if (width != '' && width != null){ windowFeatures = windowFeatures+'width='+width+','; } if (height != '' && height != null){ windowFeatures = windowFeatures+'height='+height+','; } if (resizable){ windowFeatures = windowFeatures+'resizable,'; } if (location){ windowFeatures = windowFeatures+'location,'; } if (menubar){ windowFeatures = windowFeatures+'menubar,'; } if (scrollbars){ windowFeatures = windowFeatures+'scrollbars,'; } if (status){ windowFeatures = windowFeatures+'status,'; } if (toolbar){ windowFeatures = windowFeatures+'toolbar,'; } window.open(URL, windowName, windowFeatures); } //--> </script>
Copy the following code between the <BODY></BODY> tags of your html page.<a href="javascript:winOpen('http://www.java-scripts.net', '', 640, 480, true, false, false, false, false, false)">Java-scripts.net</a>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email