firebug: how to place breakpoints into code

Firebug allows you to easily place breakpoints through it’s interface:

  • display your js file into firebug
  • find the line where you want to place your breakpoint
  • click on the line number with the mous and you should see a red disc representing your breakpoint

Alternatively, if you want to make firebug break upon executing a certain line from your code itself (ie. without going through the above process), simply write ‘debugger;’ into your js code. When this line gets executed, firebug will automatically opens itself and break on this line. From that on, you can debug your app.

2 Comments: Trackback URL | Comments RSS

  1. pl Says:

    just type "debugger;" in your javascript code. This will set a breakpoint
  2. ellayararwhy Says:

    I have FFox 3.1, Firebug 1.4.3 and can click on a Javascript line all day and not set a breakpoint. There is bo red disc that shows up on a line of interest. I then wrote 'debugger' on the line just before where I wanted to start debuigging - no go there, either. I can't find this "Script" icon anywhere in the FFox tool bar ?Can you tell me what the heck is wrong with my FFox? It used to breakpoint just fine about a year ago (I have added only one or two other plug ins since then). Thank you

Post a Comment

Your email is never published nor shared. You're allow to say what you want...