JavaScript Programmer’s Reference Arguments.caller (Property) The object that (Web server on xp)

JavaScript Programmer’s Reference Arguments.caller (Property) The object that called the function that owns the arguments. Availability: JavaScript 1.1 JScript 5.5 Internet Explorer 5.5 Netscape 3.0 Deprecated Property/method value type: Arguments.object JavaScript syntax: -myArguments.caller This property refers to an Arguments object belonging to a parent function. Function call tracing can traverse a hierarchy based on Arguments objects to unwind a call stack. This might be useful when debugging complex script projects. You can work out the calling tree by tracing the callee and caller relationships back up the execution context tree. The caller is a reference to the arguments object of the caller of the function. To reference the function that called the current one, use this: arguments.caller.callee To get the name of the function that called the current one use this (so long as the interpreter supports the name property on functions): arguments.caller.callee.name With this, you could build a stack trace function that you can call and will unwind the calling context stack to show you how you got to the location you are in. Tools such as this are useful to have around and if they are in a separate .js file, you can include them when you need to debug a script problem. When the caller value is Null, it refers to the global code context because there is no arguments array in that context at least not in a web browser. Other host implementations may provide an additional level of arguments according to how the script is executed. This has no meaning outside of the context of a function. The example shows how to walk up the calling tree and should yield the following output when it is run: level2 called by level1 called by global level
Note: If you are looking for high quality webhost to host and run your jsp application check Vision florida web design services

Leave a Reply