So I've recently started a new job doing some front-end JS work.
I can't show you the code for obvious reasons and I'm not even going to bother obfuscating it because its a huge amount of code (by my standards at least - several K lines spread over a couple of files).
I'll cut straight to the point, there is a popup box that can be accessed by two separate buttons.
If you could help me with debugging techniques at least, that would be great. Specifically:
1. Is there a way to break into the click event handler for a button element?
2. Is there a way to figure out what JS function created a specific DOM element? (I'm not sure when or what created the popup box in the first place)
ps, am I supposed to call it an event handler or a callback? or something else entirely?
Javascript Event-Handler Debugging Help
Page 1 of 17 Replies - 516 Views - Last Post: 11 September 2012 - 05:27 PM
Replies To: Javascript Event-Handler Debugging Help
#2
Re: Javascript Event-Handler Debugging Help
Posted 05 September 2012 - 10:14 PM
1. modern JS debuggers let you set breakpoints anywhere (if that’s what you mean).
#3
Re: Javascript Event-Handler Debugging Help
Posted 06 September 2012 - 12:11 AM
yes....thats the thing, i have no idea when the click event handler was added or even what function was attached.
if I could just click the button and automatically break into the next line of JS code to run, that's all I'm looking for. preferably, it would be smart enough to NOT break into any jquery.js code.
if I could just click the button and automatically break into the next line of JS code to run, that's all I'm looking for. preferably, it would be smart enough to NOT break into any jquery.js code.
#4
Re: Javascript Event-Handler Debugging Help
Posted 06 September 2012 - 12:47 AM
where the handler is added you have to find manually. good debuggers show you at least the functions that are registered to the event.
#5
Re: Javascript Event-Handler Debugging Help
Posted 06 September 2012 - 01:34 AM
i really hate javascript. 
thanks for the help anyways
thanks for the help anyways
#6
Re: Javascript Event-Handler Debugging Help
Posted 06 September 2012 - 01:37 AM
compared to Java or C++ it is totally different. Many people hate it because of that ...
#7
Re: Javascript Event-Handler Debugging Help
Posted 06 September 2012 - 01:57 AM
i think its even worse when you're a c# guy (that would be me). I've been very spoiled by the VS debuggers
#8
Re: Javascript Event-Handler Debugging Help
Posted 11 September 2012 - 05:27 PM
With my SplinTech Javascript Debugger I can debug this scenario completely without knowing which function will be called and in which file.
Especially for that I added a feature to Pause in 5 seconds, that lets me skip all mouse over events and get in position before I click the button that will call that code.
Check it out: www.javascript-debugger.com
Daniel
www.remotedebugger.com
Especially for that I added a feature to Pause in 5 seconds, that lets me skip all mouse over events and get in position before I click the button that will call that code.
Check it out: www.javascript-debugger.com
Daniel
www.remotedebugger.com
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|