FAQ Topic - How do I get my browser to report javascript errors?

F

FAQ server

-----------------------------------------------------------------------
FAQ Topic - How do I get my browser to report javascript
errors?
-----------------------------------------------------------------------

Various browsers include mechanisms for reporting javascript
errors in more or less detail but often they need to be enabled
or actively viewed. The quick way of activating error messages
in the Windows version of IE is to wait until a little yellow
triangle appears at the left end of the status bar, double click
on it and, when the error dialog box appears, check the "Always
show errors" checkbox it contains. It is also possible to
enable/disable error reporting from the "Internet Options"
dialog available through the menus. Mac IE error reporting is
enabled through the preferences dialog.

Netscape, Mozilla and other Gecko-based browsers have a javascript
console that displays errors. It can be viewed by typing ` javascript: `
into the address bar, and it is sometimes also available as a menu item.

There is also a Firebug extension for Mozilla based browsers:

http://www.getfirebug.com/

Opera's JavaScript console can be opened from the Tools menu
(Tools > Advanced > JavaScript console). Alternatively, you can
have it open automatically by selecting the "Open JavaScript
console on error" checkbox in the Javascript preferences Section.

For Safari see:

http://developer.apple.com/internet/safari/faq.html#anchor14


===
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers.
 
W

Walton

-----------------------------------------------------------------------
FAQ Topic - How do I get my browser to report javascript
errors?
-----------------------------------------------------------------------

Various browsers include mechanisms for reporting javascript
errors in more or less detail but often they need to be enabled
or actively viewed. The quick way of activating error messages
in the Windows version of IE is to wait until a little yellow
triangle appears at the left end of the status bar, double click
on it and, when the error dialog box appears, check the "Always
show errors" checkbox it contains. It is also possible to
enable/disable error reporting from the "Internet Options"
dialog available through the menus. Mac IE error reporting is
enabled through the preferences dialog.

Netscape, Mozilla and other Gecko-based browsers have a javascript
console that displays errors. It can be viewed by typing ` javascript: `
into the address bar, and it is sometimes also available as a menu item.

There is also a Firebug extension for Mozilla based browsers:

http://www.getfirebug.com/

Opera's JavaScript console can be opened from the Tools menu
(Tools > Advanced > JavaScript console). Alternatively, you can
have it open automatically by selecting the "Open JavaScript
console on error" checkbox in the Javascript preferences Section.

For Safari see:

http://developer.apple.com/internet/safari/faq.html#anchor14

===
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is athttp://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers.

There is a new developer console for Opera. Haven't played with it
much, but it seems a lot like firebug. You can find it here:

http://dev.opera.com/articles/view/opera-developer-tools/?page=2
 
M

Matthias Watermann

-----------------------------------------------------------------------
FAQ Topic - How do I get my browser to report javascript errors?
-----------------------------------------------------------------------

Various browsers include mechanisms for reporting javascript errors in
more or less detail but often they need to be enabled or actively viewed.
[...]

That can be helpfull in certain situations. But ...
It doesn't help the developer if the user sees any problems in her
JS-console unless she's (a) motivated to (b) startup her email-program,
(c) figure out my email address, (d) manually type in all the information
she sees in the JS-console (the one I've seen don't allow cut&paste) and
finally (e) send me the report.

I tried assigning a function (sending the error related data vie POST
directly to the web-server) to the "window.onerror" property. But, alas,
this works with some browsers (e.g. Firefox) but not with others (e.g.
Opera).

So I wonder whether there's cross-browser way to instantly send feedback
to the responsible developer instead of relying on the user's mood.



--
Matthias

/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
 
R

Richard Cornford

Matthias said:
begin On Thu, 22 Mar 2007 00:00:01 +0000, FAQ server wrote:
That can be helpfull in certain situations.

Particularly the situation where you are trying to write effective
software that operates in a web browser.
But ...
It doesn't help the developer if the user sees any problems
in her JS-console

The user should absolutely never see an error in their javascript
console (or any other indication of an error). They should not see
them mostly because software design, implementation, testing and
QA should have identified and eliminated all sources of errors.
But in practice users will not see errors because users will not
enable active error reporting (and probably should not).
unless she's (a) motivated to (b) startup her email-program,
(c) figure out my email address, (d) manually type in all the
information she sees in the JS-console (the one I've seen don't
allow cut&paste) and finally (e) send me the report.
<snip>

The point of telling people how to view errors is so that novices can
start to deal with situations where there code does not function as
expected. It is not an attempt to get users to compensate for inadequate
QA.

Richard.
 
M

Matthias Watermann

The user should absolutely never see an error in their javascript
console (or any other indication of an error). They should not see them
mostly because software design, implementation, testing and QA should
have identified and eliminated all sources of errors.

Quite true. The only problem is, that I don't have the ressources (money,
room, energy etc.) to buy, learn and operate all possible OS/Browser
combinations. I'm already checking with Firefox, Konqueror, Mozilla,
M$IE, Netscape, Opera. Sometimes you can modify a JavaScript class to
work around some browser flaws. But only if you see them with the
OS/browser combination you have at hand. Sometimes different browser
versions behave differently, sometimes the same version behaves
differently on other OSes. Sometimes ...

In any case, you have to _see_ the browser's problems before you can even
think about writing a workaround. I'm not talking about programming
errors (i.e. bugs). There are none in my software once I release it. But
there are lots of problems with web-browsers ignoring both the ECMAScript
and the W3C standards. That's the point where "window.onerror" comes in
handy. But as I said the my other posting, it's not supported either by
all browsers.

That's why I asked for a cross-browser way to detect (and feed back)
browser errors. Well, I could wrap every code block that might even
remotely be "dangerous" in a try/catch but to me that's just cheating. I
want to know about the problems so that I can fix them.

I take it, you don't know such a cross-browser error detection mechanism
either. Well, thanks for your comments nevertheless. Knowing that
obviously there is no such thing is better than being in doubt.


--
Matthias

/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>
, Sun, 1 Apr 2007 01:31:20, Richard Cornford
The user should absolutely never see an error in their javascript
console (or any other indication of an error). They should not see
them mostly because software design, implementation, testing and
QA should have identified and eliminated all sources of errors.

That's impractical. When a new browser version is released, it may have
a new bug, or a feature which, while compatible with ISO 16262, differs
from that of other browsers and from that which authors have not
doubted. Example : FF2 Date.UTC D<0 although that may be a true bug.

Authors cannot reasonably be expected to test all "live" pages with
every new browser version immediately on its release; they are often
asleep, on holiday, etc., at the time. Some, alas, are deceased.

When the javascript engine has reason to believe that the result cannot
be as the author intended, it should warn the user.

Probably each browser should have a choice of two error reporting levels
: (A) an Icon or Word of Warning (of non-trivial size) which when
selected pops up a "sorry, I cannot understand this page properly" with
suitable controls for, /inter alia/, giving fairly full debug info,
which would be given directly by (B).
But in practice users will not see errors because users will not
enable active error reporting (and probably should not).

For the above reason, there should always be visible error indication.
 

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
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top