Hi sshah,

I've never done that, but isn't there a way to save the window name
instead and close a windows depending on it's name after??
That could do something like that:

var windowHandle = "";
var windowList={};
var windowNumber=1;

 function openWindow2(URL) {
       var windowId='capswin'+(windowNumber++)
        windowHandle = window.open
(URL,windowId,'toolbar=no,resizable=1')
//        var windowStr = Object.toJSON(windowHandle);
        windowList[windowId]=windowHandle
        document.cookie = "iamWindowManager=" + windowId;
 }

and so you could remove the window by checking its name, get the
window object corresponding (which is saved in the windowList
parameter) and close the window when needed??

--
david

On 28 mai, 23:39, sshah <[email protected]> wrote:
> Hello
>
> I need to serialize an object to JSON, but the following code returns:
>
> Stack overflow at line: 547
>
> var windowHandle = "";
>
>  function openWindow2(URL) {
>         windowHandle = window.open(URL,'capswin','toolbar=no,resizable=1')
>         var windowStr = Object.toJSON(windowHandle);
>         document.cookie = "iamWindowManager=" + windowStr;
>  }
>
> How can I serialize the wiindowHandle object?
>
> I am trying to maintain a list of window objects in the cookie so that
> I can close all open windows when the main windows closes. If there is
> a better way to do this, please let me know.
>
> thanks in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to