debugging javascript

Paul King sciguy-Ja3L+HSX0kI at public.gmane.org
Sun Aug 31 20:26:56 UTC 2008


On Sun, 2008-08-31 at 11:27 -0400, Scott Elcomb wrote:
> On Sun, Aug 31, 2008 at 9:20 AM, Paul King <sciguy-Ja3L+HSX0kI at public.gmane.org> wrote:
> > I am teaching myself AJAX, and have now gotten to the point where no
> > syntax errors are reported. I am using Javascript and HTML for now, to
> > get a dropdown menu.
> >
> > The failed script follows an example in Steven Holzner's Ajax Bible pp
> > 379-400. It's at: http://hackingajax.alimentarus.net/sixth.shtml, if
> > anyone wants to see the error console.
> >
> > I have tried ddd, greasemonkey, and a number of other debuggers,
> > including firefox's own error console, under Linux. All of them have
> > seem to have this same screwball way of numbering the lines. Apparently
> > the error is being reported on line 344 on a file which has only 150 or
> > so lines.
> >
> > When seen under Explorer, the page is completely blank.
> >
> > If anyone can shed light on this issue, I would be grateful.
> 
> 
> Off the top of my head I can think of two ways that line numbers might
> be reported wrong:

The "line numbers" problem has not been really addressed, but I have
found other ways of rooting out errors. There now appear to be no errors
reported by the debugger, but there is still one runtime error left: the
menu simply does not show up. But if I point my browser to "items1.txt",
the text file displays in the browser. Greasemonkey shows that the file
is in fact read. However, the list inside the file is not parsed into
menu items.

I don't know if the problem is that
XMLHttpRequestObject.OnReadyStateChange is assigned a function but is
never called. This is the place where the menu is supposed to display.
But my understanding is that it is not supposed to be called. It is
supposed to be triggered by an event.

Another culprit is that the list is never parsed for some reason. So, at
least now I have a couple of leads.

Thanks to all for your help so far.

Paul King


--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list