1

I would like to execute every code step by step after the debugger keyword in Firebug. In the following example JSFiddle the execution halts when the form is clicked because of the debugger keyword in the onclick attribute. Subsequently I click Step Into in Firebug but instead of showing the jQuery code, it shows nothing... How to make Firebug halt at the jQuery code?

<form method="get" onclick="debugger">
    <input type="text" name="q" value="">
    <input type="submit" value="Search Google">
</form>

jQuery code:

$('form').submit(function() {
    document.title = "How to shown this line in debugger?";
    return confirm('Are you sure you want to search Google?');
});
8
  • yes, i clicked Step Into too, all it show is "debugger" word instead of showing document.title = "How to shown this line in debugger?"; Commented Jul 27, 2014 at 11:37
  • 2
    because that is where you have debugger, if you want to debug the callback function put debugger inside it Commented Jul 27, 2014 at 11:38
  • @PatrickEvans sorry about the question.. in the above example i can add debugger, but i can do that in other websites :( Commented Jul 27, 2014 at 11:40
  • Just use Chrome :-) It has pause-on-next-event built in Commented Jul 27, 2014 at 11:42
  • 1
    Note that when you place the debugger keyword inside the click event handler, you'll just be able to debug that event handler. What you want to debug, though, is the completely unrelated submit event handler. Commented Jul 27, 2014 at 21:06

1 Answer 1

3

For Firebug

  1. Go to the Script panel

  2. Click the dropdown for the scripts and select the script you need

  3. Add a breakpoint on the line you want to start debugging from

For Chrome

  1. Go to the console
  2. Then to the Sources tab

  3. Click "show navigator" button

  4. Select the script

  5. Click the line number you wish to debug from

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.