In any programming language, I can trace any function and know that the witch's function is different but in Javascript I do not know how? Since the code has not been written by me and the firebug does not give this feature - as I know.
An example:
When I click on the XYZ element, it is said that the function names for each function are displayed.
Thanks
found this :, they say a
< Pre> function printstackTrace () {var callstack = []; Var isCallstackPopulated = false; {I.dont.exist + = 0; // does not exist - this is the same) hold (e) {if (e.stack) {/ / Firefox Varna Lines = E. stack split ('\ n'); For (var i = 0, len = lines.length; i & lt; len; i ++) {if (lines [i]. Milan (/ ^ \ s * [A-za-x 0-9 \ _C $] + \ (/)) {callstack.push (line [i]);}} // print staxtres () remove call call callstack.shift (); isCallstackPopulated = true;} and if (window .apa & Amp; A Message) {// Opera Ver Line = E. Message Split ('var i = 0, len = lines.length; i & lt; len; i ++) {if (Lines [i] .match (/ ^ \ s * [A-Za-z0-9 \ -_ \ $] + \ (/)) {var entry = lines [i]; // next line also combines, Because it has file information if (line [i + 1]) {entry = = "A" + [i + 1]; i ++;} callstack push (entry);}} // Remove call to print StackTrace () callstack.shift (); iCalctackPipulated = true;}} If (IsCallstackPopulated) {// IE Safari var current function = argument calee.caller; while (current function) {var fn = currentFunction.toString (); var fname = fn.substring (fn.indexOf ("function") + 8, fn.indexOf ('') ) || anonymous; callstack.push (fname); CurrentFunction = currentFunction.caller; }} Output (callstack); } Function output (ARR) {// output though you want to alert (arr.join ('\ n \ n')); }
Comments
Post a Comment