Custom Js Error Messages
11
when an javascript error is occured , instead of showing the default error message by the system, we can show the our own cusom error message like this.
function handleErrors(msg, url, line)
{
var errorString = "JavaScript Error Occured\n";
errorString += "Message: "+msg+"\n";
errorString += "Url: "+url+"\n";
errorString += "Line: "+line;
alert(errorString);
return true;
}
window.onerror = handleErrors;






I've got good news, and I've got bad news:
The universe is merely a figment of my imagination.
Now are you ready for the bad news?
function handleErrors(msg, url, line) {
return true;
}
window.onerror = handleErrors;