I'm having problems accessing a global array variable from within a
function. I have something like this:
------------------------------------
var detail = new Array( 20 );
detail[ 0 ] = "hello";
function ShowDetail( ) {
top.frames[2].document.clear ();
top.frames[2].document.write ("<html><body>" );
top.frames[2].document.write ( detail[ 0 ] );
top.frames[2].document.write ("</body></html>");
top.frames[2].document.close ();
}
------------------------------------
When I call ShowDetail(), I expect it to write "hello" in the frame, but
instead it writes "undefined. " What am I doing wrong?
Thanks,
Greg.
function. I have something like this:
------------------------------------
var detail = new Array( 20 );
detail[ 0 ] = "hello";
function ShowDetail( ) {
top.frames[2].document.clear ();
top.frames[2].document.write ("<html><body>" );
top.frames[2].document.write ( detail[ 0 ] );
top.frames[2].document.write ("</body></html>");
top.frames[2].document.close ();
}
------------------------------------
When I call ShowDetail(), I expect it to write "hello" in the frame, but
instead it writes "undefined. " What am I doing wrong?
Thanks,
Greg.
Comment