Disable Javascript Errors
This simple script will prevent javascript errors from being displayed in your visitor's browser
<script type="text/javascript">
function noError(){
return true;
}
window.onerror = noError;
</script>
The functionality is very simple: create a function that always returns true, and then whenever an error occurs, call this function (returning true and suppressing the error).
Shamefully, this script is only tested in IE.
21.02.2007. 19:08
Abhishek said on 11.08.2008. 11:54
Really great!!
Hugo Decosta said on 18.09.2008. 12:14
Pretty good! IE kills me with those warnings, some time without reason. Thanks!
Satish said on 01.04.2009. 06:12
great tool. thanks.
denns said on 08.04.2009. 04:56
this actually does not work in IE7... tried and it failed :(
Kered said on 18.12.2009. 17:24
well I must say this a great.
Well Done !!!!!!
Hermit said on 21.01.2010. 22:01
Thanks!
nithiyalakhsmi said on 26.02.2010. 11:56
Many Thanks! This script gives end to my script problem in ie6.
Martin said on 04.03.2010. 16:24
Awesome tiny script!
Thanks
ASIF MEHMOOD said on 16.04.2010. 08:36
Well done dear! its fine.
Bundle of
Thanxxxxxxxxxxxxxxxxxxxxxxxxxx.
Bryant said on 07.05.2010. 08:34
To bad i didnt see this sooner, would have saved me headaches in the past. IE seems to trip out over jQuery stuff, so i can't even make it go away most of the time.
gabriele said on 25.05.2010. 09:22
Really great!!
you have solved a big problem!!!
thanks a lot!!
Avo said on 08.07.2010. 10:18
is this inserted in the head after the scripts? or simply at the footer just before the body?
aNieto2k said on 13.08.2010. 09:53
This is a bad solution for real applications, information is lost on the errors produced. Undoubtedly the best option is always to use a proper error handling.
try {
...
} Catch (e) {
...
}
Recent Responses:
Page last (manually) updated: December 23, 2009.
Questions, comments, insults or praise? Have your say: