【发布时间】:2012-05-14 14:29:56
【问题描述】:
可能重复:
Can I get the name of the currently running function in javascript?
在 Javascript 中有没有一种方法可以获取执行 javascript 的方法/函数的名称。 我想要
alert('此消息在方法内运行时出现' + GetCurrentMethodName());
【问题讨论】:
标签: javascript
可能重复:
Can I get the name of the currently running function in javascript?
在 Javascript 中有没有一种方法可以获取执行 javascript 的方法/函数的名称。 我想要
alert('此消息在方法内运行时出现' + GetCurrentMethodName());
【问题讨论】:
标签: javascript
像这样使用arguments.callee.name:
alert('This message is coming while running inside the method ' + arguments.callee.name);
【讨论】: