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 badges5 Answers
Reset to default 12While 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.
- Hit CMD + O from the Sources Panel with an open file
- Enter :5:9
- 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