Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
114
rated 0 times [  116] [ 2]  / answers: 1 / hits: 20396  / 13 Years ago, tue, october 18, 2011, 12:00:00

I'm just curious to know

Is there ANY ways in ANY browser to find out where the alert I get is raised from?



I tried it in chrome but there is no call stack available when alert shows.



Any idea?


More From » html

 Answers
4

You can overwrite alert, and create an Error for the stack trace:



var old = alert;

alert = function() {
console.log(new Error().stack);
old.apply(window, arguments);
};

[#89555] Monday, October 17, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
minab

Total Points: 701
Total Questions: 104
Total Answers: 91

Location: Saint Pierre and Miquelon
Member since Fri, Jan 28, 2022
2 Years ago
;