标签:函数 nbsp this logs code 显示 div caller 属性
funcName.caller : 返回一个对函数的引用, 该函数调用了当前函数
function test() { if (test.caller) { var a = test.caller.toString(); alert(a); } else { alert("this is a top function"); } } function test2() { test(); } test(); // this is a top function test2(); // 显示函数 test2 的文本
标签:函数 nbsp this logs code 显示 div caller 属性
原文地址:http://www.cnblogs.com/upup2015/p/7782631.html