最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - How to stop in FireBug when submit button is pressed? - Stack Overflow

matteradmin6PV0评论

I want to stop (break) in the first function called whenever a submit button is pressed in a form. How can I set a break-point for this in Firebug?

I know how to stop in any line in a function. But in one case I don't know which function is getting called upon pressing "submit" button.

I want to stop (break) in the first function called whenever a submit button is pressed in a form. How can I set a break-point for this in Firebug?

I know how to stop in any line in a function. But in one case I don't know which function is getting called upon pressing "submit" button.

Share Improve this question edited Apr 25, 2012 at 2:33 KatieK 13.9k19 gold badges78 silver badges91 bronze badges asked Mar 31, 2011 at 8:08 user5858user5858 1,2217 gold badges42 silver badges84 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

So your real problem is that you don't know which function is being called (once you know that you can use breakpoints).

Try enabling the 'Net' tab, select 'All' and click 'Persist'. This will show you a list of functions that are being called. Hit the submit button and expand the first function in the list. This is the first function being called after submitting.

Open Firebug, go to the script tab and select the script you want. I think you can either click the number of the line (on the left), or on the right hand panel you can create "breakpoints" which will stop the script at the points you designate.

Type this into the Firebug console - it will stop any form on that page from submitting and display the id. You will need to include jquery with the page if you haven't already.

$("form").submit(function() {
  console.log(this.id);
  return false;
});
Post a comment

comment list (0)

  1. No comments so far