Hi David

Thanks for the reply. You are right that we can save the window variable 
in an array and that works just fine.  However, the problem is 
maintaining this information across requests.
ie. I can open the window on 1 page and click on the "close window" link 
a few requests later.

Is there a way to keep the windowList across requests? If so, that would 
solve the problem. I was trying to searlize the object and store it as a 
cookie to get around this.

Thanks
Suneet


david wrote:
> 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 <suneetshah2...@gmail.com> 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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to