How do you launch the JavaScript debugger in Google Chrome?

前端 未结 15 1361
失恋的感觉
失恋的感觉 2020-11-22 03:33

When using Google Chrome, I want to debug some JavaScript code. How can I do that?

相关标签:
15条回答
  • 2020-11-22 03:58

    In Chrome 8.0.552 on a Mac, you can find this under menu View/Developer/JavaScript Console ... or you can use Alt+CMD+J.

    0 讨论(0)
  • 2020-11-22 04:00

    Ctrl + Shift + J opens Developer Tools.

    0 讨论(0)
  • 2020-11-22 04:05

    These are the tools you see

    Press the F12

    0 讨论(0)
  • 2020-11-22 04:11

    Here, you can find the shortcuts to access the developer tools.

    https://developer.chrome.com/devtools/docs/shortcuts

    0 讨论(0)
  • 2020-11-22 04:14

    Try adding this to your source:

    debugger;
    

    It works in most, if not all browsers. Just place it somewhere in your code, and it will act like a breakpoint.

    0 讨论(0)
  • 2020-11-22 04:16

    The most efficient way I have found to get to the javascript debugger is by running this:

    chrome://inspect

    0 讨论(0)
提交回复
热议问题