How to get the correct line number for an error in IE?

  • Thread starter Thread starter John Dalberg
  • Start date Start date
J

John Dalberg

I have an html page that has a few includes for javascript, css and other
html. The page gives a 'syntax error' in line 72. Putting the page's source
in an editor and going to line 72 shows an html line that looks good.
There's no Javascript anywhere near that line and Firefox's Javascript
console doesn't show any error. I don't know if this error is related to
Javascript.

So how does one get the exact line where this error comes from?
 
John said:
I have an html page that has a few includes for javascript, css and other
html. The page gives a 'syntax error' in line 72. Putting the page's source
in an editor and going to line 72 shows an html line that looks good.
There's no Javascript anywhere near that line and Firefox's Javascript
console doesn't show any error. I don't know if this error is related to
Javascript.

So how does one get the exact line where this error comes from?

The best way to deal with this is to use Mozilla or Firefox, which have
much better JS consoles.

For IE, 'line 72' typically means line 72 of some file, but IE prefers
to keep the filename secret, so you have to check the HTML file plus any
JS files you use.
 
John Dalberg said:
I have an html page that has a few includes for javascript, css and other
html. The page gives a 'syntax error' in line 72. Putting the page's source
in an editor and going to line 72 shows an html line that looks good.
There's no Javascript anywhere near that line and Firefox's Javascript
console doesn't show any error. I don't know if this error is related to
Javascript.

So how does one get the exact line where this error comes from?

Using a script debugger.
Uncheck (in Options, Advanced tab, Browsing section):
Disable script debugging (Internet Explorer)

You might as well do this using the Internet Options Control Panel
applet because this is another one the undocumented (requires restart)
options. In any case after that option is unchecked you will (eventually)
see an new submenu in the View menu called Script Debugger.
Activating it will allow you to see script source with the associated line
numbers.

Otherwise as C A Upsdell indicated you will need to find the
source files manually and then do some arithmetic.

Note that in many cases the filenames are not "secret" at all.
Assuming the files are cacheable (e.g. not marked uncacheable)
all you need to do is use the TIF viewer with a Details view, sorted
by Last Accessed to find files which are referred to by the page's
(or frames's) View Source. E.g. press Alt-T,O,Alt-S,V Alt-V,D
Alt-V,I,Last Accessed. BTW once you have set the TIF viewer's
preferences the only part of that command sequence which is
usually necessary is the first.

Note also that if you are dragging the files to Notepad for inspection
that XP's Notepad now has a Status bar which can show you line
numbers (when Wrap is off). Alt-o,W Alt-V,S
That at least could help reduce a tedious counting exercise
to a relatively simple calculation.


HTH

Robert Aldwinckle
---
 
Back
Top