Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: JavaScript
Expertise: Beginner
Feb 20, 2007

WEBINAR:

On-Demand

Full Text Search: The Key to Better Natural Language Queries for NoSQL in Node.js


Improved JavaScript Error Handling

To supress JavaScript error messages, simply place this snippet in the Head section of your Web page:

<SCRIPT language="JavaScript">
function dontshowerrormessages() {return true;}
window.onerror=dontshowerrormessages;
</SCRIPT>
An even better method is to use the following code:
 
<SCRIPT language="JavaScript">
function betterhandler(description,pagename,lineno)
{
 alert(
  'An Error occurred! \n'
  +'\n Description: \t'+description
  +'\n Page Name:      \t'+pagename
  +'\n At Line :       \t'+lineno
 )
 return true
}
window.onerror=betterhandler;
Srinath MS
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date