Reputation: 3234
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.
Upvotes: 3
Views: 8682
Reputation: 1046
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
Upvotes: 0
Reputation: 289
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.
Upvotes: 3
Reputation: 3234
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.
Upvotes: 12
Reputation: 23958
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
Upvotes: 1
Reputation: 1037
Ctrl + G
/ Cmd + G
like anywhere else.
Your solution requires a one more step to achieve the goal
Upvotes: 7