C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Try Catch Using JavaScript
WhatsApp
Delpin Susai Raj
Aug 24
2016
771
0
0
<html>
<head>
<script type=
"text/javascript"
>
var
txt =
""
;
function
message() {
try
{
adddlert(
"Welcome guest!"
);
}
catch
(err) {
txt =
"There was an error on this page.\n\n"
;
txt +=
"Error description: "
+ err.description +
"\n\n"
;
txt +=
"Click OK to continue.\n\n"
;
alert(txt);
}
}
</script>
</head>
<body> <input type=
"button"
value=
"click"
onclick=
"message()"
/> </body>
</html>
Try Catch
JavaScript
Up Next
Try Catch Using JavaScript