最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to go to a specific line in a java script file in Chrome Developer Tools? - Stack Overflow

programmeradmin0浏览0评论

Most of the time we are dealing with big java script files. And while debugging we need to locate specific line in script files. I realized that there is no information for this in stackoverflow, and wanted to supply answer here. This is how to go to a specific line in a java script file in Chrome Developer Tools. See the answer below.

Most of the time we are dealing with big java script files. And while debugging we need to locate specific line in script files. I realized that there is no information for this in stackoverflow, and wanted to supply answer here. This is how to go to a specific line in a java script file in Chrome Developer Tools. See the answer below.

Share Improve this question edited Jan 14, 2017 at 13:57 ozanmut asked Jan 13, 2017 at 15:05 ozanmutozanmut 3,23429 silver badges23 bronze badges
Add a comment  | 

5 Answers 5

Reset to default 12

While a java script file is open in the sources tab, press CTRL + O type a colon and line number after it :[LineNo] (:575 etc) enter.

If you want to go to specific column on a specific line then use two colons to specify line number and column number at the same time :[LineNo]:[ColumnNo] (:575:50 etc) enter.

Ctrl + G / Cmd + G like anywhere else.

Your solution requires a one more step to achieve the goal

Ctrl + G for Mac so that you don't have to type :. Other options is to press CMD+P and type : and type the line number.

The information you mentioned is documented by Umar on the Google Developers web site.

GOTO a line number with a specified column using the format :linenumber:columnnumber in the CMD+O dialogue from the Sources panel editor.

  1. Hit CMD + O from the Sources Panel with an open file
  2. Enter :5:9
  3. Notice you are taken to line 5, column 9!

Source: Go to a line number at a specific column

everyone here is correct about the CMD+G but you can actually set it up to whatever you want in the settings.

I personally set it to be the same shortkey as the intellij IDE

发布评论

评论列表(0)

  1. 暂无评论