gimecoffee
MIS
- Mar 3, 2006
- 25
In other programming languages I've used you can the value of one variable as a variable name.
For example:
I'm tracking child windows and want to be able to send the name of the window I want to open to a function.
----------------------------------------------
function f_open_child(x) {
x=window.open('','', 'width=200,height=200,left=200,top=200');
}
var x = "test123";
f_open_child(x);
x.document.write('This is a test window.');
----------------------------------------------
In this case the name of the window becomes 'x' and I'd like it to be 'test123' so I can have multiple windows and control what is going to each.
Any suggestions?
Tusen Tuk
For example:
I'm tracking child windows and want to be able to send the name of the window I want to open to a function.
----------------------------------------------
function f_open_child(x) {
x=window.open('','', 'width=200,height=200,left=200,top=200');
}
var x = "test123";
f_open_child(x);
x.document.write('This is a test window.');
----------------------------------------------
In this case the name of the window becomes 'x' and I'd like it to be 'test123' so I can have multiple windows and control what is going to each.
Any suggestions?
Tusen Tuk