Error Handling in Javascript
<div class="jumbotron">
<button class="btn btn-danger" onclick="myFunc()">Click Me</button>
</div>
/* var myFunc=function()
{
var a = 100;
var b = 0;
try
{
throw("Divide by zero");
var c = a / b;
}
catch(e)
{
alert(e);
}
finally {
alert("in finally");
}
}*/
window.onerror=function(msg,url,ln)
{
alert(msg);
alert(url);
alert(ln);
}
Comments
Post a Comment