mozilla
您的搜索结果

    caller

    已废弃
    This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

    概述

    返回调用当前正在执行的函数的函数.

    Property of arguments
    Implemented in JavaScript 1.1
    ECMAScript Edition None

    描述

    该属性已经不可用, 请使用Function.caller代替.

    示例

    下例演示了arguments.caller属性的作用.

    function whoCalled() {
       if (arguments.caller == null)
          console.log('该函数在全局作用域内被调用.');
       else
          console.log(arguments.caller + '调用了我!');
    }

    文档标签和贡献者

    此页面的贡献者有: ziyunfei, teoli
    最后编辑者: teoli,