How to debug an error?

Discussion in 'JavaScript' started by lost, Oct 20, 2005.

  1. #1
    I have a piece of javascript code and whenever i execute it, it shows on the bottom of the webpage "Error on page". How do i go about debugging it?
     
    lost, Oct 20, 2005 IP
  2. torunforever

    torunforever Peon

    Messages:
    414
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You're using Internet Explorer, right? Since you're only getting the "Error on page" message at the bottom, you must have the Advanced option "Display a notification about every script error" turned off. That's ok, because you can still view the details by double clicking on the icon/message at the bottom. It will open up a dialog, and you might have to click Show Details to view the error information. It gives you the line number and a brief description of the problem. That should get you started in debugging the problem.
     
    torunforever, Oct 20, 2005 IP
  3. torunforever

    torunforever Peon

    Messages:
    414
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I have some more information for javascript debugging.

    I use Firefox all the time, and they have a nice javascript console. If you don't have Firefox installed, I'd recommend it at least to test out your pages. In the Tools menu, you'll find the JavaScript Console, in which there's a history of error messages that have occurred. Like the IE dialog, it will report the line number and a message. The Firefox console messages are usually a little more detailed than the Internet Explorer messages.

    If you're feeling adventurous, then you can try out a really cool Firefox extension called JavaScript Debugger a.k.a. Venkman.
    https://addons.mozilla.org/extensions/moreinfo.php?id=216&vid=512

    If you've ever used a debugger for other languages, you'll be able to use the tool easily. If not, then you might want to start by reading the FAQ
    http://www.hacksrus.com/~ginda/venkman/faq/venkman-faq.html
     
    torunforever, Oct 20, 2005 IP
  4. lost

    lost Peon

    Messages:
    144
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks guys, both of those suggestions helped.
     
    lost, Oct 21, 2005 IP
  5. SuperMishka

    SuperMishka Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Try JavaScript Debugger.
    http://yaldex.com/JSFactory_Pro.htm
     
    SuperMishka, Jun 21, 2006 IP
  6. dimi

    dimi Peon

    Messages:
    82
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    you can use firefox addons or microsoft script debugger or Microsoft Visual studio 2003, 2005
     
    dimi, Jun 26, 2006 IP