| JavaScript - Functions Scope | | Print | |
The statements within a
function body have access to all global variables defined somewhere else in the
document. The variables defined within a function body, however, can only be
used inside the function itself. As soon as the function returns control to the
calling statement, all variables declared within it are deleted and their memory
freed.
The function itself has a global scope in the window in which it was defined. In the event that you need to call a function defined on a different frame, you will need to precede its name with the name of the frame, as follows:
parent.<frame name>.<function name>( <parameter list> );
Not preceding the non-local function with its frame name will cause the function to be undefined by the interpreter and will generate an error.
Published in Website, JavaScript
This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a comment.
| Users' Comments (0) |
|
No comment posted




