View Full Version : Javascript debugger
Vermelh0
09-18-2002, 09:09 PM
Could anybody point me to a good javascript debugger... I believe mozilla comes with one, but I'm developing for IE and since both browsers seem to be javascript incompatible...
V
joh6nn
09-18-2002, 09:42 PM
the only javascript debugger i've ever seen, is the one for Moz, and i couldn't get it to work. i also didn't see a big need for one of that nature. there's this: http://www.codingforums.com/showthread.php?s=&threadid=5772 , which you might find useful, but other than that, the only thing i can suggest is just make sure that you have script debugging turned on, and use alerts to keep track of what's going on in your code
Vermelh0
09-18-2002, 10:31 PM
>the only thing i can suggest is just make sure that you have script debugging turned on
Hum, how do I check this???? I'm using an IIS webserver, do I need to enable something on it? My problem is that basically, when an error occurs, I get a warning saying on which line the error occurred, but 99.9999999% that line is not even javascript, it's html. So it doesn't help me anything.
V
Roy Sinclair
09-18-2002, 10:52 PM
One problem is that the "line number" you see in the error is the line number of the page as rendered to the browser and will only be the same line number on the source page if you haven't used any kind of server side includes or scripting.
The key to finding the right line is to view-source the page, copy the viewed source from notepad (or the Netscape viewer) and paste it into a text editor that'll report which line you're on.
I usually debug by adding alerts at strategic points to verify that things contain what I expect them to. However, when debugging mouse position sensitive items I'll post the information to the status line instead.
Catman
09-18-2002, 11:03 PM
I like keeping the script and html in a single file during the development phase -- that way the line numbers for errors make sense.
chrismiceli
09-18-2002, 11:15 PM
ie script debugger sux but if you want it go to internet options and click the advanced tab. One of the checkboxes is disable script debugger, uncheck it, one under is something else about script debugging. When it is on and it isn't working (the script) in the bottom corner there will be a yellow icon, where it usually is and e. double click on it for a ok debugger.
Vermelh0
09-18-2002, 11:39 PM
chrismiceli, thanks.... a sucky debugger is still better than no debugger... :)
>The key to finding the right line is to view-source the page, copy the viewed source from notepad (or the Netscape viewer) and paste it into a text editor that'll report which line you're on.
This is what I've done many times, but it's driving me crazy. It never coincides with an error. I guess it's due to the fact that I have javascript everywhere on the page, including in one 10KB js file.
Well, I'll be crossing my fingers on the IE debugger... I really don't want to put all my javascript on one page, so I'm hoping it doesn't have to come down to that :)
Thanks everybody,
V
Roy Sinclair
09-20-2002, 09:55 PM
The little yellow icon is NOT the IE debugger but any good developer runs with the option set to always let you know about javascript errors. Otherwise you might think your page is working fine when there's really a problem needing fixed.
The IE Debugger (http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/001/731/msdncompositedoc.xml) can be downloaded from the MS Scripting site.
It's a lot more complete than the simple error message with the misleading line numbers.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.