Home | Javascript validator | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.
Microsoft® JScript®
caller Property
 Language Reference 
Version 2 

See Also                  Applies To


Description
Returns a reference to the function that invoked the current function.
Syntax
functionname.caller
Remarks
The caller property is only defined for a function while that function is executing. If the function is called from the top level of a JavaScript program, caller contains null.

If the caller property is used in a string context, the result is the same as functionname.toString, that is, the decompiled text of the function is displayed.

The following example illustrates the use of the caller property:

function CallLevel()
{
  if (CallLevel.caller == null)
    return("CallLevel was called from the top level.");
  else
    return("CallLevel was called by another function.");
}

Home | Javascript validator | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.