0

Possible Duplicate:
Can I get the name of the currently running function in javascript?

In Javascript Is there a way I can get the name of the method/ function inside which the javascript is getting executed. I want

alert('This message is coming while running inside the method ' + GetCurrentMethodName());

Community
  • 1
  • 1
Enggr
  • 627
  • 2
  • 14
  • 27

1 Answers1

1

Use arguments.callee.name like this:

alert('This message is coming while running inside the method ' + arguments.callee.name);
Elliot Bonneville
  • 51,872
  • 23
  • 96
  • 123