I'd suggest doing this (if absolutely necessary, because it seems clunky) in your _javascript_ code on the front end.  Why?  Browsers tend to allow popups for a site if they are triggered by a user event (button click, for example) rather than when the page opens (porn ad).

In the onclick, have a funciton that keeps count.  When you have your max, just pop up an alert box (rather than another window).

When the user closes a window, in the 'onunload', call opener.[your js function].  You might have to call ' opener.document.[your js function]'.  One of them will work.  Anyway, in this function, just free up one of the windows.

I'd second the div suggestion, or you could open a single long window with these values side by side, if you want to compare them.

Have a page refresh and non-event popups is asking for headaches.

On 10/17/06, David Delbecq <[EMAIL PROTECTED] > wrote:
Rønnevik a écrit :
> Hi!
Hi
>
> Does anybody see another/a better way of handling this? How to respect a popup limit? Any ideas / new approaches would have been appreciated. I've been thinking of having a global array in _javascript_ that holds the handlers to the popup-windows, and then somehow manage the rendering based on the size of this array, but the problem is that when I refresh the parent page this array is reset as well, so I cannot go down that path.
>
Couldn't you do one of those simpler solutions?

1) don't care about number of popups (fast, easy, but sometimes the
client want ... strange specifications like popup limitations)
2) Have your application cycle amongst popup names (popup-1, popup-2,
...), this way, when you click, you just select the next name. No need
to handle popups states in hashmap and play with onload. If popup was
closed, it will be reopen, else, it will have the new content)
3) Handle you popup as draggable DIV inside main window. This is a bit
of work and might not meet gui requirements, but at least the only way
user can close the DIV is clicking the [X] button.
> Regards,
>
> Eivind
>
>
>
>


Reply via email to