Debugging frontend JavaScript

javascript

#1

Q1.
I have a javascript project that’s run on Apache because it uses an index.html wrapper (not sure if all the terminology is correct), and I don’t know where to look for the console.log messages, they don’t show up in the bash or immediate tabs.

Q2.
Also, the debugger doesn’t stop at any breakpoints. The little bug is green and the breakpoints are solid red.


#2

Hi,

Thank you for writing in. If you’re looking to debug client side Javascript code, you’ll have to use the debugger present in your Browser’s Developer Tools. The Node debugger present within Cloud9 is for server side code only, and as the client Javascript is run on the browser, that can only be debug there.

You can find more information about debuggers present in various browsers here:

Chrome: https://developers.google.com/web/tools/chrome-devtools/debug/breakpoints/
Firefox: https://developer.mozilla.org/en/docs/Debugging_JavaScript
IE: https://msdn.microsoft.com/en-us/library/gg699336(v=vs.85).aspx

Regards,
​Mutahhir