On CBS.com: Elephant fights a group of dogs

Open cascading windows

Tags: Guest Contributor

  • Save
  • Print
  • Digg This
  • 0

Takeaway: With JavaScript, you can open more than one window consecutively. Here's how.

By Brent Lee Metcalfe

In addition to opening windows simultaneously, you can open more than one window consecutively. Suppose you build a site whose initial HTML file launches two subwindows from the main browser. The first subwindow could function as the primary information display, the second as a navigational device. This would allow users the option of closing the main browser, giving Web builders control over all navigational elements.

Each window is the parent (or opener) of the subwindow that opens after it. Pop-up 1 is launched from the main browser. Pop-ups 2 through 4 open when the preceding subwindow loads. The code below, for example, opens Pop-up 2 from the Pop-up 1 HTML file:

<script language="javascript">
<!--
var no2 = null;

function cascade2() {
  no2 = window.open('cascade2.html','cas2','dependent,width=175,height=175,left=20,top=20');
}
//-->
</script>

<body … onLoad="cascade2()" … >

Brent Lee Metcalfe is a Web architecture consultant.

  • Save
  • Print
  • Digg This
  • 0

What do you think?

Article Categories

Security
Security Solutions, IT Locksmith
Networking and Communications
E-mail Administration NetNote, Cisco Routers and Switches
CIO and IT Management
Project Management, CIO Issues, Strategies that Scale
Desktops, Laptops & OS
Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
Data Management
Oracle, SQL Server
Servers
Windows NT, Linux NetNote, Windows Server 2003
Career Development
Geek Trivia
Software/Web Development
Web Development Zone, Visual Basic, .NET

Ultraportables

advertisement
Click Here