Best way to keep an ordered list of windows (from most-recently created to oldest)?

What is the best way to manage a list of windows (keeping them in order) to be able to promote the next window to the top-level when the current top-level window is closed.
This is for a web application, so we're using jQuery Javascript.

We'd talked through a few simplistic solutions, such as using an array and just treating [0] index as the top-most window.

I'm wondering if there's any potentially more efficient or useful alternative to what we had brainstormed.

-------------Problems Reply------------

A stack if you want to just close the window on top. A queue if you also need to open windows at the end.

I don't really know javascript, but couldn't you create a stack of windows?

Stack/queue in JS is a simple array, which can be manipulated with .push(val), .pop(), .shift(val) and .unshift().

Category:javascript Views:0 Time:2008-08-21
Tags: javascript

Related post

Copyright (C), All Rights Reserved.

processed in 0.077 (s). 11 q(s)