语法高亮,滚动条美化,设置页面调整

This commit is contained in:
fofolee
2019-04-19 02:41:09 +08:00
parent 1e8f76c000
commit 359d29ee0b
1590 changed files with 12328 additions and 11441 deletions

View File

@@ -1,8 +1,8 @@
<article id="wikiArticle">
<div></div>
<h2 id="信息">信息</h2>
<pre class="syntaxbox">ReferenceError: reference to undefined property "x" (Firefox)
</pre>
<pre><code class="language-javascript">ReferenceError: reference to undefined property "x" (Firefox)
</code></pre>
<h2 id="错误类型">错误类型</h2>
<p>仅在 <a href="Reference/Strict_mode">strict mode</a> 下出现 <a href="Reference/Global_Objects/ReferenceError" title="ReferenceError引用错误 对象代表当一个不存在的变量被引用时发生的错误。"><code>ReferenceError</code></a> 警告。</p>
<h2 id="哪里出错了">哪里出错了?</h2>
@@ -11,14 +11,14 @@
<h2 id="示例">示例</h2>
<h3 id="无效的">无效的</h3>
<p>本例中,<code>bar</code> 属性是未定义的,隐藏 <code>ReferenceError</code> 会出现。</p>
<pre class="brush: js example-bad">"use strict";
<pre><code class="language-js example-bad">"use strict";
var foo = {};
foo.bar; // ReferenceError: reference to undefined property "bar"
</pre>
</code></pre>
<h3 id="无效的_2">无效的</h3>
<p>为了避免错误,您需要向对象添加 <code>bar</code> 的定义或在尝试访问 <code>bar</code> 属性之前检查 <code>bar</code> 属性的存在;一种检查的方式是使用 <a href="Reference/Global_Objects/Object/hasOwnProperty" title="hasOwnProperty() 方法会返回一个布尔值,指示对象自身属性中是否具有指定的属性"><code>Object.prototype.hasOwnProperty()</code></a> 方法。如下所示:</p>
<pre class="brush: js example-good">"use strict";
<pre><code class="language-js example-good">"use strict";
var foo = {};
@@ -31,7 +31,7 @@ console.log(foo.bar); // "moon"
if (foo.hasOwnProperty("bar") {
console.log(foo.bar);
}</pre>
}</code></pre>
<h2 id="相关">相关</h2>
<ul>
<li><a href="/en-US/docs/Web/JavaScript/Reference/Strict_mode">Strict mode</a></li>