My favorite "secret weapon" for JS debugging is sprinkling my .js templates with statements like this:<p><pre><code> //alert('DEBUG: FunctionName() begins, param1 = ' + param1 + '; param2 = ' + param2);
</code></pre>
My JS injector has a 'debug' setting, which rewrites all of those statements into one of: console.log(), document.title=(), or confirm(), the latter of which stops appearing after I press 'No' or 'Cancel'.<p>When not debugging on a modern browser with debugging tools like IE6+VS, Firefox, Opera, Safari, or Chrome, it is a real time-saver to be able to toggle those messages, kind of like a poor man's breakpoint.<p>(I develop retro sites which are designed to live up to the "any browser" dream, so I test with NN2+, IE3+, and Opera3+, in addition to Lynx, w3m, Links, Dillo, NetSurf etc., not to mention the mainstream FF, Chrome, Edge, Safari.)