A customized JavaScript error handler

SearchDomino.com member Hemang Kapadia offers a customized JavaScript error handler that replaces a default Web browser error message with a detailed pop-up.

This tip was submitted to the SearchDomino.com tip library by member Hemang Kapadia. Please let others know how useful it is via the rating scale at the end of the tip. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.


With this JavaScript code, you'll be able to create a customized JavaScript error handler that will show a pop-up of the error details. This will replace the default error message at the bottom left of the Web browser.
<script>
function customHandler(desc,page,line,chr)  {  alert(
  'JavaScript error occurred! n'
 +'While every effort was made to test this site in a 
variety of browsers on a variety of platforms, 
it seems something still went wrong. Browsers that have 
been tested include Microsoft Internet Explorer 6+ n '
 +'nError description: t'+desc
 +'nPage address:      t'+page
 +'nLine number:       t'+line
 )
 return true
}

window.onerror = customHandler; 
</script>

Do you have comments on this tip? Let us know.

This was last published in May 2006

Dig Deeper on Lotus Notes Domino Agents

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close