I am looking for handling JS errors using try-catch
statement, but its not alerting the Error the way I supposed it has to pop up error. Let me know what I am doing wrong here in the code.
Code testing browser - FireFox
Code -
<script type="text/javascript">
try {
document.write(parseInt("15"); // Broken code
}
catch(e) {
alert("Error " + e.description);
}
</script>
When I firebug
the code its only showing the error in the try block that was all supposed to be but no alert
pop up that ss what I am expecting.
Site reference I made before asking -
http://www.tutorialspoint.com/javascript/javascript_error_handling.htm
Error handling in javascript [Answer is referring to the same above mentioned URL]