Suppressing JavaScript Error Messeges - Application/Page Level

if you having problem with Ajax Extensions, Ajax Toolkit controls..etc generating bad JavaScript code that cause the message "Error On Page" to appear on the status bar of your browser then you can't solve this by resolving the error or wrappe the whole thing in try/catch blocks.

What you need is suppress the error on a whole page, specific or on master page to simulate application level effect using this snippet in the HEAD section.

 

<SCRIPT language="JavaScript">

function silentErrorHandler() {

return true;

}

window.onerror=silentErrorHandler;

</SCRIPT>

 

Happy Coding..

Published 05-12-2008 6:33 AM by Adel Khalil

Leave a Comment

(required) 
(required) 
(optional)
(required)