How to debug javascript?

I have old javascript code from about 2000-2002, which (surprisingly) still works in IE, but not in Firefox, Chrome, Opera, etc. I already learned about some quirks, some browsers do some things this way, some others. Thus, there are snippets of code on the Internet for creating a platform-independent, user-independent function.

Now my problem is to find the problems. There are buttons on the website right now, when I click on them, something happens in IE, but Firefox does nothing. There is even a mistake. I tried going through javascript Firebug, but at some point in the code, when I do the next debugging step, the script just aborts without any error message. This will not continue with the following statement. Strange enough, and I have no idea what causes it or how to fix it.: /

So, how do I debug javascript, so I get error messages telling me what the problem is, for example, what function / variable that I use is not defined in firefox or when I use the wrong parameters.

thanks and best regards Mark

+3
source share
3 answers

Firefox does not display error messages or put them in the status bar (for example, IE). You need to open the error console to see the errors.

Firefox places Javascript errors in the Error Console, but also HTML and CSS errors and warnings.

, , , IE . IE quirks IE . , , IE , IE . , script , , IE , .

+2

Firebug firefox . , , . , " " "" . , .

, "" . script , .

+3

FireBug, Firefox.

EDIT: Doh, .

+2

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


All Articles