debugexample4.htm
来自「这是javascript高级程序设计的源码」· HTM 代码 · 共 27 行
HTM
27 行
<html>
<head>
<title>Debug Example</title>
<script type="text/javascript">
function divide(iNum1, iNum2) {
if (arguments.length != 2) {
throw new Error("divide() requires two arguments.");
} else if (typeof iNum1 != "number" || typeof iNum2 != "number") {
throw new Error("divide() requires two numbers for arguments.");
}
return iNum1.valueOf() / iNum2.valueOf();
}
alert(divide("a"));
</script>
</head>
<body>
<p>This page throws a custom JavaScript error.</p>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?