Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
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
755
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