Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
47
rated 0 times [  48] [ 1]  / answers: 1 / hits: 8111  / 11 Years ago, tue, december 10, 2013, 12:00:00

I've inherited some large piece of code. Somewhere inside a way too generalised e.preventDefault() is prohibiting the normal behavior of an anchor click.



I thought about running profiler in Chrome webtools to see what is happening when clicking on a particular link, hoping to trace it back to the culprit statement. However I haven't had much luck



how can I trace back (if possible) a statement that is overriding normal click behavior, when clicking a link in Chrome webtools?
(I am using jQuery)


More From » javascript

 Answers
4

You should be able to override Event.prototype.preventDefault and add a debugger statement as its first line.



Run the following via the console.



var oldEPD = Event.prototype.preventDefault;
Event.prototype.preventDefault = function() {
debugger;
oldEPD.call(this);
};

[#49679] Monday, December 9, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
madilynndiannac

Total Points: 191
Total Questions: 93
Total Answers: 111

Location: France
Member since Thu, Oct 15, 2020
4 Years ago
;