Files
YellowLabTools/test/www/try-catch.html
T
Gaël Métais 50eacba438 Fix Error 1001: JavaScript profiling failed (#197)
Fix for Error 1001: JavaScript profiling failed
2016-12-20 12:21:20 +08:00

21 lines
604 B
HTML

<html>
<head>
<title>Testing getElementById with a try catch statement</title>
</head>
<body>
<div id="foo">Some text</div>
<script>
try {
document.getElementById(undefined);
document.getElementsByClassName(undefined);
document.getElementsByTagName(undefined);
} catch(err) {
console.log('Error found: ' + err);
throw new Error("I detect an error!");
}
document.getElementById('foo');
</script>
</body>
</html>