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

Discussion in 'Javascript' started by FAQ server, Mar 22, 2007.

  1. FAQ server

    FAQ server Guest

    -----------------------------------------------------------------------
    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.
     
    FAQ server, Mar 22, 2007
    #1
    1. Advertising

  2. FAQ server

    Walton Guest

    On Mar 21, 7:00 pm, "FAQ server" <> wrote:
    > -----------------------------------------------------------------------
    > 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
     
    Walton, Mar 22, 2007
    #2
    1. Advertising

  3. begin On Thu, 22 Mar 2007 00:00:01 +0000, FAQ server wrote:

    > -----------------------------------------------------------------------
    > 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
    / \
     
    Matthias Watermann, Mar 24, 2007
    #3
  4. Matthias Watermann wrote:
    > begin On Thu, 22 Mar 2007 00:00:01 +0000, FAQ server wrote:

    <snip>
    >> Various browsers include mechanisms for reporting javascript
    >> errors in more or less detail ... .

    <snip>
    > 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.
     
    Richard Cornford, Apr 1, 2007
    #4
  5. begin On Sun, 01 Apr 2007 01:31:20 +0100, Richard Cornford wrote:

    > 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
    / \
     
    Matthias Watermann, Apr 1, 2007
    #5
  6. In comp.lang.javascript message <eumugi$spv$1$>
    , Sun, 1 Apr 2007 01:31:20, Richard Cornford
    <> posted:
    >
    >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.

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
     
    Dr J R Stockton, Apr 2, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. FAQ server
    Replies:
    0
    Views:
    154
    FAQ server
    Aug 15, 2006
  2. FAQ server
    Replies:
    17
    Views:
    181
    Matt Kruse
    Aug 23, 2006
  3. FAQ server
    Replies:
    24
    Views:
    237
    Dr J R Stockton
    Dec 29, 2006
  4. FAQ server
    Replies:
    1
    Views:
    226
    Dr J R Stockton
    Oct 16, 2008
  5. FAQ server
    Replies:
    22
    Views:
    300
    Garrett Smith
    May 14, 2010
Loading...

Share This Page