Skip to content

Instantly share code, notes, and snippets.

@h4
Created April 2, 2012 19:47
Show Gist options
  • Save h4/2286706 to your computer and use it in GitHub Desktop.
Save h4/2286706 to your computer and use it in GitHub Desktop.
Обработка исключений
<html>
<head>
<script type="text/javascript">
var txt="";
function message() {
try {
adddlert("Welcome guest!");
}
catch(err) {
txt="Ошибка на странице.\n\n";
txt+="Описание ошибки: " + err.description + "\n\n";
txt+="Щелкните по кнопке OK, чтобы продолжить.\n\n";
alert(txt);
}
}
</script>
</head>
<body>
<input type="button" value="Просмотреть сообщение" onclick="message()" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment