How does one go about debugging javascript?

Discussion in 'JavaScript' started by xarzu, Aug 29, 2013.

  1. #1
    How does one go about debugging javascript?
    Do you use firebug and run your page through your localhost?
    If javascript is part of an ASP.NET application, I have found that the breakpoints in a .js file in Visual Studio seem to be ignored.
    The problem I see is that the ASP.NET application which uses javascript code has too versions -- a published and a debug version. The Debug version is located within my group of folders under the localhost. Also, when I launch the program through Visual Studio, it defaults to IE. Is there some way I can have it launch a different browser that will allow for javascript debugging?
    Is there a step-by-step description somewhere?

    Javascript seems to be very popular. I imagine a debugger is in use. So, what is it and how can you use it if your javascript is already part of an asp.net web site/page?
     
    xarzu, Aug 29, 2013 IP
  2. HuggyStudios

    HuggyStudios Well-Known Member

    Messages:
    724
    Likes Received:
    20
    Best Answers:
    26
    Trophy Points:
    165
    #2
    I use Google Chrome, it has in my opinion the best developer tools. You can set the break points in the JS file and that makes debugging a lot easier. Please see the screen shot below with a break point added.

    [​IMG]
     
    HuggyStudios, Aug 30, 2013 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #3
    I usually just use the error consoles in FF and Opera...

    Though I would never use visual studio or ASP for anything serious -- particularly given how doing ANYTHING in ASP.NET from visual studio pisses all over the markup.

    But again, if you are making code for the web and 'need' anything more complex than the average programmers editor / notepad replacement, you're probably doing it all wrong!
     
    deathshadow, Aug 30, 2013 IP
  4. JoeSimmons

    JoeSimmons Greenhorn

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #4
    I use Firebug.
     
    JoeSimmons, Sep 3, 2013 IP
  5. SadClown

    SadClown Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    33
    #5
    I second using Google Chrome to debug Javascript. It's so easy to use and all you have to do to open the console and all the tools is "ctrl + shift + j".
     
    SadClown, Sep 10, 2013 IP