error, assert and trace
This commit is contained in:
Родитель
4e670cdf63
Коммит
98478f481e
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>JavaScript error and trace creation in the Console tool</title>
|
||||
<link rel="shortcut icon" type="image/ico" href="favicon_io/favicon.ico"/>
|
||||
<link rel="stylesheet" href="demostyles.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>I've reported a few issues 😳</h1>
|
||||
<p>There is nothing to see here, you need to open the Developer Tools and check the console for the output.</p>
|
||||
<p>Select <code>Control</code>+<code>Shift</code>+<code>J</code> (Windows, Linux) or <code>Command</code>+<code>Option</code>+<code>J</code> (macOS).</p>
|
||||
|
||||
|
||||
<script>
|
||||
function first(name) { second(name); }
|
||||
function second(name) { third(name); }
|
||||
function third(name) {
|
||||
if (!name) {
|
||||
console.error(`Name isn't defined :(`)
|
||||
} else {
|
||||
console.assert(
|
||||
name.length <= 8,
|
||||
`"${name} is not less than eight letters"`
|
||||
);
|
||||
}
|
||||
}
|
||||
first();
|
||||
first('Console');
|
||||
first('Microsoft Edge Canary');
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>JavaScript error and trace creation in the Console tool</title>
|
||||
<link rel="shortcut icon" type="image/ico" href="favicon_io/favicon.ico"/>
|
||||
<link rel="stylesheet" href="demostyles.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>I've logged a trace 🪜</h1>
|
||||
<p>There is nothing to see here, you need to open the Developer Tools and check the console for the output.</p>
|
||||
<p>Select <code>Control</code>+<code>Shift</code>+<code>J</code> (Windows, Linux) or <code>Command</code>+<code>Option</code>+<code>J</code> (macOS).</p>
|
||||
|
||||
<script>
|
||||
function here() {there()}
|
||||
function there() {everywhere()}
|
||||
function everywhere() {
|
||||
console.trace();
|
||||
}
|
||||
here();
|
||||
there();
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче