- Dec 1, 2000
- 2,419
- 0
- 0
I have some global variable called
var x
Now, in function A, I want to pass x to function B and have it be initialized... I don't want a COPY of x initialized, I want x initialized:
function a()
{
b( x );
}
function b( variable_to_init )
{
variable_to_init = new ActiveXObject("stuff");
}
Now as far as I can tell, x is getting passed by value or some such thing to b, and then I get the message that "x has no properties" when I try to use it elsewhere.
Is there a way to do this in JavaScript? I could show you the C++ code I'd use...
var x
Now, in function A, I want to pass x to function B and have it be initialized... I don't want a COPY of x initialized, I want x initialized:
function a()
{
b( x );
}
function b( variable_to_init )
{
variable_to_init = new ActiveXObject("stuff");
}
Now as far as I can tell, x is getting passed by value or some such thing to b, and then I get the message that "x has no properties" when I try to use it elsewhere.
Is there a way to do this in JavaScript? I could show you the C++ code I'd use...