JS_Debugging

Michal Čihař edited this page Apr 14, 2016 · 2 revisions

Setting a breakpoint (Chrome or Firefox+Firebug)

Step 1

Open the js file where you want to set a breakpoint. In our example it's db_operations.js

Step 2

Insert the "debugger;" statement (without the quotes) right before the line for which you want to set the breakpoint.

Step 3

Go to desired page in your web browser, in our example it's db_operations.php.

Step 4

Refresh the page. Do not skip this, it's necessary to have the correct version of the js files loaded when setting the breakpoint.

Step 5

Click on the element that triggers the event handler that we are interested in. In our example, we submit the rename database form.

Step 6

You will see a red dot appear to confirm that you have set a breakpoint (click again to remove it).

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.