O.k., this may be a stupid question but it is time I found out how to track down errors in scripts.
My question is: when an error appears on a page it usually says... error on line "xxx". How do you find line "xxx" ? other than counting down lines????






timjpriebe posted this at 16:33 — 11th May 2007.
He has: 2,666 posts
Joined: Dec 2004
Use an editor that displays line numbers next to the lines.
For Windows, ScITE is one such editor.
teammatt3 posted this at 18:33 — 11th May 2007.
He has: 1,902 posts
Joined: Sep 2003
Are you using notepad? Just hit ctrl g and type in the line number. Make sure word wrap is turned off, or it won't work.
My Site | Regular Expression Tester
Megan posted this at 18:47 — 11th May 2007.
She has: 10,288 posts
Joined: Jun 1999
You may also be able to use the web developer extension for whichever browser you are using, or change your default source viewer to something that shows line numbers. I've found this helpful when the generated source is different from the original source. Then you can use the toolbar extension to view the generated source and check for the right line number.
Your HTML editor may not show the line numbers by default - look for an option to turn them on. Most editors should have this option available.
Megan
My web design blog
webwiz posted this at 04:04 — 12th May 2007.
He has: 339 posts
Joined: May 2007
Opera and Firefox have error consoles that display meaningful error messages caused by both JavaScript and CSS errors. Tools > Error Console in FF2; Tools > Advanced > Error Console in Opera.
IE does have a debugger, but I found it hard to use.
Did you know about Firebug?
Cordially, David
--
"Old web developers don't die, they degrade gracefully..."
cbc58 posted this at 12:09 — 15th May 2007.
They have: 140 posts
Joined: Nov 2003
thanks very much.