ozanmut
ozanmut

Reputation: 3234

How to go to a specific line in a java script file in Chrome Developer Tools?

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

Answers (5)

Ivan Yulin
Ivan Yulin

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

enter image description here

Upvotes: 0

Binoy S Kumar
Binoy S Kumar

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

ozanmut
ozanmut

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

Gideon Pyzer
Gideon Pyzer

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.

  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!

Go to a line number at a specific column

Source: Go to a line number at a specific column

Upvotes: 1

Sergei Klykov
Sergei Klykov

Reputation: 1037

Ctrl + G / Cmd + G like anywhere else.

Your solution requires a one more step to achieve the goal

Upvotes: 7

Related Questions