Standard way to debug javascript / jquery

This is my usual way to debug javascript. Enable alert (0); to break the stream and find out what is happening.

sometimes when i need some breakpoints i do

alert('the flow is now in function 1');
alert('the flow is now in function 2');

or sometimes just

alert('success');

I would like to know if there is a standard way for debugging accepted as I find my current method very intrusive.

thanks in advance..:)

+3
source share
4 answers

you can use the console ... for example in firebug

debugger;, script - , firebug (demo)

+4

Firebug Firefox , IE8 javascript. , ..

+1
0

.

JavaScript

,

("the standard debugging method for javascript / jquery ") and replacing it:
 JavaScript: warning (. document.getElementById ('comments-2521535') innerHTML);

and press Enter to start the fragment on the page. It is very similar to the Firebug console.

0
source

Source: https://habr.com/ru/post/1738618/


All Articles