debugging advice

A

Adrian

Hi
I have an HTML page that loads 3 or 4 JS files under some conditions it
gives a script error on line 100 the html is only 10 or so lines long. So
when working out which line is in error do I count each line in each JS file
in order from the point at which they are loaded?

is there an app that would do that for me?

thanks
 
R

RobG

Adrian said:
Hi
I have an HTML page that loads 3 or 4 JS files under some conditions it
gives a script error on line 100 the html is only 10 or so lines long. So
when working out which line is in error do I count each line in each JS file
in order from the point at which they are loaded?

is there an app that would do that for me?

Use Firefox (or similar such as Mozilla or Netscape) and the JavaScript
console. It will (most probably) tell you exactly where the error is
with a link to the line in the file - you don't even need an editor with
line numbering (though of course it would help).
 
A

Adrian

Thanks Rob,
Only one issue with that (my fault I should have said!) the site is
internal and only supports IE (5.5 and above).

Any other app I can use?
 
D

Dr John Stockton

JRS: In article <[email protected]>,
dated Wed, 9 Nov 2005 17:35:17, seen in
Adrian said:
I have an HTML page that loads 3 or 4 JS files under some conditions it
gives a script error on line 100 the html is only 10 or so lines long. So
when working out which line is in error do I count each line in each JS file
in order from the point at which they are loaded?

Probably.

You should, of course, be able to test using local files; once you have
counted as well as you can, you can if necessary pin down the line more
exactly by inserting a blank line and seeing whether the error line
number changes.

Another approach would be to take a copy of the page, copy into it the
included files, and debug that. Once the problem is understood, solved,
and tested in that it should be easy enough to fix the echt version.
 
R

RobG

Adrian said:
Thanks Rob,
Only one issue with that (my fault I should have said!) the site is
internal and only supports IE (5.5 and above).

I don't see that makes any difference. You will generally find
programming in Firefox to be much better than in IE, you will quickly
learn where the differences are and learn to avoid them.

Of course you need to test frequently and thoroughly in IE as you go.

Any other app I can use?

There is the MS Script Editor that comes with Microsoft Office 2002 (and
newer I think), but that may be too high a price to pay and for
JavaScript and HTML it is awful

I just played with it again and it told me that 'title' is not a valid
attribute of an A element, it uses Microsoft Windows file paths with
backslashes, suggests and uses depreciated attributes, etc. I've had
enough.

I must say it looks a million dollars, but because of its misleading
advice, lack of decent support for web technologies and overly fussy UI,
it's worse than using a plain text editor.

Back to EditPlus...


[...]
 
J

jussij

There is the MS Script Editor .... and for JavaScript
and HTML it is awful

Take a look at the Zeus for Window IDE:

http://www.zeusedit.com/features.html
Note: Zeus is shareware (45 day trial).

It has features like configurable syntax highlighting, ftp/sftp
editing, project/workspace management, integrated version
control etc.

Zeus can even check you HTML for W3C conformance using
the Tidy HTML utility:

http://www.zeusedit.com/forum/viewtopic.php?t=194

Jussi Jumppanen
Author: Zeus for Windows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top