Loading ...
Sorry, an error occurred while loading the content.
 

Re: [JavaScript] for error handling what should use

Expand Messages
  • Jonas Raoni
    ... It seems that it exists on IE since the version 5.0, I don t know about the other browsers, but every modern browser must support this... Anyway, you
    Message 1 of 5 , Jan 31, 2006
      2006/2/1, deepak pal <deepak_javascript@...>:
      > for error handling in javascript what should be use try catch or onerror event ,is try catch
      > is supported by all browser

      It seems that it exists on IE since the version 5.0, I don't know
      about the other browsers, but every modern browser must support
      this...

      Anyway, you should avoid using the "try..catch" block for simple
      errors, simple errors must be corrected...

      Try to use it just for unespected errors, like invoking an activex or
      when there's a known "throw" statement like in the bellow snippet...

      function test(){
      throw new Error("strange error =O");
      }

      try{
      test();
      }catch(e){
      alert(e);
      }


      --
      Jonas Raoni Soares Silva
      http://www.jsfromhell.com
    • a.geo
      mmm, Mozilla family dont work with modal windows... IE (ok, stop with the tomatoes... AAAA!!!!) work fine with this... this is better to receive user info
      Message 2 of 5 , Feb 4, 2006
        mmm, Mozilla family dont work with modal windows... IE (ok, stop with the
        tomatoes... AAAA!!!!) work fine with this... this is better to receive user
        info than combo, for example a big list of items, helped by criteria
        searcher... etc... etc,... then you block the parent window until the user
        choice a item.


        Cesar

        --
        --------------------------------------------------------
        AGEO : http://www.geocities.com/aquiles.geo


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.