Debugging Javascript Errors in IE

Discussion in 'JavaScript' started by rederick, Jan 24, 2006.

  1. #1
    Hello,

    I've got some javascript code that works perfectly fine in Firefox, yet doesn't quite work right in IE.

    Does anyone know a good way to debug error in Javascript code in IE? Like in Firefox there is the JS console that points out exactly what line in the Javascript code there is an error. IE has the worst error messages. I get
    Line: 340
    Char: 277
    Error: Invalid Argument
    Code: 0
    URL: http://mywebsite.com/phpfile.php

    Pretty useless if you ask me :)

    Thanks

    Red
     
    rederick, Jan 24, 2006 IP
  2. dave487

    dave487 Peon

    Messages:
    701
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It tells you what line the error is on which should be enough for you to debug it.

    View source and go to line 340 and see whats there. If you post the code around it maybe I can help.
     
    dave487, Jan 26, 2006 IP
  3. rederick

    rederick Peon

    Messages:
    128
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah, that is part of the problem, I don't have 340 lines of javascript code, only about 120 so I am not sure where it starts counting. After thinking about the error "invalid Argument" also, What could this mean? I would assume that I am passing and invalid argument to a function? I wish IE had some better development support, or just be more like firefox :rolleyes:
     
    rederick, Jan 28, 2006 IP
  4. dave487

    dave487 Peon

    Messages:
    701
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It refers to the line number of the entire html source file.

    If you open it in notepad you can do crtl+g or something to go to whatever line you want.
     
    dave487, Jan 30, 2006 IP