Function test1 runs and alerts the argument values but when function 2 runs I get "x is undefined".
If I declared the variables x y z either global or local I get an empty alert.
Can someone educate me here
<script>
function test1(x,y,z){
alert(x+" "+y+" "+z)
undefined is a top-level property and is not associated with any object.
A variable that has not been assigned a value is of type undefined. A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value.
-james
__________________
"God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "
Last edited by jamescover; 07-16-2004 at 08:34 AM..
<script>
function test1(x,y,z){
alert(x+" "+y+" "+z)
}
setTimeout("test2(x,y,z)",2000); //outside the function
function test2(x,y,z){
alert(x+" "+y+" "+z)
}
</script>
-james
__________________
"God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "
Last edited by jamescover; 07-16-2004 at 08:49 AM..