Forum Moderators: open

Message Too Old, No Replies

popup window and array

New member

         

Angel

8:22 am on Jan 13, 2004 (gmt 0)

10+ Year Member



I am using popup window to display some data . Want to pass array from popup window to update parent window.

How do i capture the values from popup window.
Is it possible to capture the array value?

jatar_k

2:31 am on Jan 14, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld Angel,

I am not really sure about passing arrays using JS, I don't know of a way off the top of my head.

It would really depend on how much information we are talking about. If there are only a few values in the array they could be broken up and appended to the url or possibly saved in a cookie.

Purple Martin

3:04 am on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yo can reference the popup's parent window using window.opener, and therefore you can set the value of an array variable in the parent window from the popup.

TrinkDawg

4:23 pm on Jan 14, 2004 (gmt 0)

10+ Year Member



Hi Angel,

In your popup window, you can access the parent window just like Purple Martin said, so if you want to set some array of values in the parent window you can do so like this:

in the popup window:
var importantValues = new Array(); <- this is your array you want passed to the parent.
var myParent = window.opener;
myParent.setArrayValues(importantValues); <- function call to the parent

in the parent window:
var myArray = new Array(); <- array you want to set
function setArrayValues(newArrayValues)
{
myArray = newArrayValues;
}

Hope this helps.

Angel

5:35 am on Jan 21, 2004 (gmt 0)

10+ Year Member



Thanks for the help , i was bit busy.