0

I'm fairly new to debugging and JavaScript in general. I want to find out when is being called when I click a button.

I click this button and a popup appears, I want to find out what is executed when I click that button and which code is triggering the popup.

How do I do this?

9
  • 1
    Please add some code examples describing objectively what you want to do. Commented Feb 10, 2014 at 14:11
  • Or better, run your code in <jsfiddle.net>, and you might find the answer yourself. If you still have problems, post the JSFiddle link here. Commented Feb 10, 2014 at 14:12
  • If you are talking about jQuery events binded to different elements.In firefox with firebug, try installing firequery and you will see methods binded to each element in firebug. Just click the handler and it will take you to the method in JS tab. firequery.binaryage.com Commented Feb 10, 2014 at 14:14
  • It's really as simple as debugging the source of a button. I click this button, a popup appears, I want to trace the source of that popup. I can give you some pseudo-code but it's self explanatory. JSFiddle would not solve it, it's a specific problem related to code, rather methodology. Commented Feb 10, 2014 at 14:15
  • Second this, try firebug addons.mozilla.org/en-US/firefox/addon/firebug Commented Feb 10, 2014 at 14:17

1 Answer 1

1

I am not sure what development tools you are using, but using something like Chrome Dev Tools You can record events and then show what is triggers after click events.

  • Open the inspector
  • Go to Timeline tab
  • Click Record
  • Click the button you want to debug
  • Stop the timeline
  • Investigate the Javascript (purple) events in the timeline

For deeper learning about Chrome Dev Tools, I enjoyed Code School's free class.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.