Use debugging tools supported by the browser. As mentioned above Firebug for Firefox Chrome Developer Tools from Chrome IE Developer for IE.
This way you can detect problems between browsers. To reduce cross browser issues, use the javascript framework, i.e. jQuery, YUI, moo tools, etc.
Below is a screenshot (javascript-debug.png) of what it looks like lime in Firebug.
1) hit 'F12'
2) go to the "Script" tab and "enable it" (if you are already on your page - press "F5" to reload)
3) next to the word "Everything", appears on the right. Select your javascript file from the drop-down list.
In the screenshot, I set a breakpoint on line 42 with the "left mouse button". This will allow you to tear, check, watch, etc.

CKuharski Jun 19 2018-11-18T00: 00Z
source share