TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Try Catch Using JavaScript
Delpin Susai Raj
Aug 24
2016
Code
678
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<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