diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects')
11 files changed, 16 insertions, 16 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/bigint/index.html b/files/zh-cn/web/javascript/reference/global_objects/bigint/index.html index 1ef191efc0..225cda75d6 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/bigint/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/bigint/index.html @@ -161,7 +161,7 @@ Boolean(12n) <h2 id="构造器">构造器</h2> <dl> - <dt><code><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/BigInt">BigInt()</a></code></dt> + <dt><code><a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/BigInt/BigInt">BigInt()</a></code></dt> <dd>创建{{jsxref("BigInt")}} 对象。</dd> </dl> diff --git a/files/zh-cn/web/javascript/reference/global_objects/bigint64array/index.html b/files/zh-cn/web/javascript/reference/global_objects/bigint64array/index.html index c7f47fef77..31ac75a13e 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/bigint64array/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/bigint64array/index.html @@ -11,7 +11,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/BigInt64Array <h2 id="构造函数">构造函数</h2> -<p><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array"><code>BigInt64Array()</code></a></p> +<p><a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array"><code>BigInt64Array()</code></a></p> <p> 添加一个新的<code>BigInt64Array</code>对象。</p> @@ -167,7 +167,7 @@ var bigint64 = new BigInt64Array(iterable); <h2 id="参考">参考</h2> <ul> - <li><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays" title="en/JavaScript typed arrays">JavaScript typed arrays</a></li> + <li><a href="/zh-CN/docs/Web/JavaScript/Typed_arrays" title="en/JavaScript typed arrays">JavaScript typed arrays</a></li> <li>{{jsxref("BigUint64Array")}}</li> <li>{{jsxref("DataView")}}</li> </ul> diff --git a/files/zh-cn/web/javascript/reference/global_objects/boolean/index.html b/files/zh-cn/web/javascript/reference/global_objects/boolean/index.html index 9b0ba4ae06..a236f20273 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/boolean/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/boolean/index.html @@ -51,13 +51,13 @@ var s = new Boolean(myString); // true <p>最后,不要在应该使用基本类型布尔值的地方使用 <code>Boolean</code> 对象。</p> <div class="blockIndicator note"> -<p><strong>注意:</strong>当将非标准属性<a href="https://wiki.developer.mozilla.org/en-US/docs/Web/API/Document#Properties">document.all</a>用作此构造函数的参数时,结果是值为<code>false</code>的布尔对象。 此属性是旧属性,是非标准属性,不应使用。</p> +<p><strong>注意:</strong>当将非标准属性<a href="/zh-CN/docs/Web/API/Document#Properties">document.all</a>用作此构造函数的参数时,结果是值为<code>false</code>的布尔对象。 此属性是旧属性,是非标准属性,不应使用。</p> </div> <h2 id="构造器">构造器</h2> <dl> - <dt><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean/Boolean"><code>Boolean()</code></a></dt> + <dt><a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Boolean/Boolean"><code>Boolean()</code></a></dt> <dd>创建一个新的<code>Boolean</code> 对象。</dd> </dl> diff --git a/files/zh-cn/web/javascript/reference/global_objects/encodeuricomponent/index.html b/files/zh-cn/web/javascript/reference/global_objects/encodeuricomponent/index.html index d80cd457c9..be7f03a446 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/encodeuricomponent/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/encodeuricomponent/index.html @@ -9,7 +9,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/encodeURIComponent --- <div>{{jsSidebar("Objects")}}</div> -<p><code><strong>encodeURIComponent()</strong></code>函数通过将一个,两个,三个或四个表示字符的UTF-8编码的转义序列替换某些字符的每个实例来编码 <a href="https://wiki.developer.mozilla.org/en-US/docs/Glossary/URI">URI</a> (对于由两个“代理”字符组成的字符而言,将仅是四个转义序列) 。</p> +<p><code><strong>encodeURIComponent()</strong></code>函数通过将一个,两个,三个或四个表示字符的UTF-8编码的转义序列替换某些字符的每个实例来编码 <a href="/zh-CN/docs/Glossary/URI">URI</a> (对于由两个“代理”字符组成的字符而言,将仅是四个转义序列) 。</p> <p>{{EmbedInteractiveExample("pages/js/globalprops-encodeuricomponent.html","shorter")}}</p> diff --git a/files/zh-cn/web/javascript/reference/global_objects/globalthis/index.html b/files/zh-cn/web/javascript/reference/global_objects/globalthis/index.html index 20b6dba280..7260d8cbfa 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/globalthis/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/globalthis/index.html @@ -30,7 +30,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/globalThis <p>在以前,从不同的 JavaScript 环境中获取全局对象需要不同的语句。在 Web 中,可以通过 <code>window</code>、<code>self</code> 或者 <code>frames</code> 取到全局对象,但是在 <a href="/zh-CN/docs/Web/API/Worker">Web Workers</a> 中,只有 <code>self</code> 可以。在 Node.js 中,它们都无法获取,必须使用 <code>global</code>。</p> -<p>在松散模式下,可以在函数中返回 <code>this</code> 来获取全局对象,但是在严格模式和模块环境下,<code>this</code> 会返回 <code>undefined</code>。 You can also use <code>Function('return this')()</code>, but environments that disable {{jsxref("eval", "eval()")}}, like <a href="https://wiki.developer.mozilla.org/en-US/docs/Glossary/CSP">CSP</a> in browsers, prevent use of {{jsxref("Function")}} in this way.</p> +<p>在松散模式下,可以在函数中返回 <code>this</code> 来获取全局对象,但是在严格模式和模块环境下,<code>this</code> 会返回 <code>undefined</code>。 You can also use <code>Function('return this')()</code>, but environments that disable {{jsxref("eval", "eval()")}}, like <a href="/zh-CN/docs/Glossary/CSP">CSP</a> in browsers, prevent use of {{jsxref("Function")}} in this way.</p> <p><code>globalThis</code> 提供了一个标准的方式来获取不同环境下的全局 <code>this</code> 对象(也就是全局对象自身)。不像 <code>window</code> 或者 <code>self</code> 这些属性,它确保可以在有无窗口的各种环境下正常工作。所以,你可以安心的使用 <code>globalThis</code>,不必担心它的运行环境。为便于记忆,你只需要记住,全局作用域中的 <code>this</code> 就是 <code>globalThis</code>。</p> diff --git a/files/zh-cn/web/javascript/reference/global_objects/math/random/index.html b/files/zh-cn/web/javascript/reference/global_objects/math/random/index.html index ea760c65f6..efc11b6894 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/math/random/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/math/random/index.html @@ -90,5 +90,5 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random <h2 id="相关链接">相关链接</h2> <ul> - <li><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues" title="The documentation about this has not yet been written; please consider contributing!"><code>window.crypto.getRandomValues()</code></a></li> + <li><a href="/zh-CN/docs/Web/API/RandomSource/getRandomValues" title="The documentation about this has not yet been written; please consider contributing!"><code>window.crypto.getRandomValues()</code></a></li> </ul> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html index abe605e620..1e1080be00 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html @@ -51,7 +51,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/assign <h2 id="Polyfill_2">Polyfill</h2> -<p>这个 <a href="https://wiki.developer.mozilla.org/en-US/docs/Glossary/Polyfill">polyfill</a> 不支持 symbol 属性, 由于 ES5 中本来就不存在 symbols :</p> +<p>这个 <a href="/zh-CN/docs/Glossary/Polyfill">polyfill</a> 不支持 symbol 属性, 由于 ES5 中本来就不存在 symbols :</p> <pre class="notranslate">if (typeof Object.assign !== 'function') { // Must be writable: true, enumerable: false, configurable: true diff --git a/files/zh-cn/web/javascript/reference/global_objects/promise/allsettled/index.html b/files/zh-cn/web/javascript/reference/global_objects/promise/allsettled/index.html index 919da6e0b8..d552f10680 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/promise/allsettled/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/promise/allsettled/index.html @@ -59,11 +59,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Promise/allSettled <ul> <li> -<a href="https://wiki.developer.mozilla.org/zh-CN/docs/Archive/Add-ons/Techniques/Promises">Promises</a></li> +<a href="/zh-CN/docs/Archive/Add-ons/Techniques/Promises">Promises</a></li> <li> -<a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises">Using promises</a></li> +<a href="/zh-CN/docs/Web/JavaScript/Guide/Using_promises">Using promises</a></li> <li> -<a href="https://wiki.developer.mozilla.org/zh-CN/docs/Learn/JavaScript/Asynchronous/Promises">Graceful asynchronous programming with promises</a></li> +<a href="/zh-CN/docs/Learn/JavaScript/Asynchronous/Promises">Graceful asynchronous programming with promises</a></li> <li>{{jsxref("Promise")}}</li> <li>{{jsxref("Promise.all()")}}</li> </ul> diff --git a/files/zh-cn/web/javascript/reference/global_objects/reflect/index.html b/files/zh-cn/web/javascript/reference/global_objects/reflect/index.html index b35fe77d5c..4b430c4772 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/reflect/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/reflect/index.html @@ -10,13 +10,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Reflect --- <div>{{JSRef}}</div> -<p><strong>Reflect</strong> 是一个内置的对象,它提供拦截 JavaScript 操作的方法。这些方法与<a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler">proxy handlers</a>的方法相同。<code>Reflect</code>不是一个函数对象,因此它是不可构造的。</p> +<p><strong>Reflect</strong> 是一个内置的对象,它提供拦截 JavaScript 操作的方法。这些方法与<a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler">proxy handlers</a>的方法相同。<code>Reflect</code>不是一个函数对象,因此它是不可构造的。</p> <h2 id="描述">描述</h2> <p>与大多数全局对象不同<code>Reflect</code>并非一个构造函数,所以不能通过<a href="/zh-CN/docs/Web/JavaScript/Reference/Operators/new">new运算符</a>对其进行调用,或者将<code>Reflect</code>对象作为一个函数来调用。<code>Reflect</code>的所有属性和方法都是静态的(就像{{jsxref("Math")}}对象)。</p> -<p><code>Reflect</code> 对象提供了以下静态方法,这些方法与<a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler">proxy handler methods</a>的命名相同.</p> +<p><code>Reflect</code> 对象提供了以下静态方法,这些方法与<a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler">proxy handler methods</a>的命名相同.</p> <p>其中的一些方法与 {{jsxref("Object")}}相同, 尽管二者之间存在 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/Comparing_Reflect_and_Object_methods">某些细微上的差别</a> .</p> diff --git a/files/zh-cn/web/javascript/reference/global_objects/regexp/index.html b/files/zh-cn/web/javascript/reference/global_objects/regexp/index.html index 27da890c46..2a1e6ffcf5 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/regexp/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/regexp/index.html @@ -200,7 +200,7 @@ console.log(regex.lastIndex); // prints "15" // and so on</pre> -<p><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Unicode_Property_Escapes">Unicode属性转义特性</a>引入了一种解决方案,它允许使用像\p{scx=Cyrl}这样简单的语句。这里有一个外部资源,用来获取 Unicode 中的不同区块范围:<a href="http://kourge.net/projects/regexp-unicode-block" title="http://kourge.net/projects/regexp-unicode-block">Regexp-unicode-block</a></p> +<p><a href="/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions/Unicode_Property_Escapes">Unicode属性转义特性</a>引入了一种解决方案,它允许使用像\p{scx=Cyrl}这样简单的语句。这里有一个外部资源,用来获取 Unicode 中的不同区块范围:<a href="http://kourge.net/projects/regexp-unicode-block" title="http://kourge.net/projects/regexp-unicode-block">Regexp-unicode-block</a></p> <h3 id="从_URL_中提取子域名">从 URL 中提取子域名</h3> diff --git a/files/zh-cn/web/javascript/reference/global_objects/set/index.html b/files/zh-cn/web/javascript/reference/global_objects/set/index.html index 49ede8bf54..3e8c53dc64 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/set/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/set/index.html @@ -26,7 +26,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set <h2 id="Constructor">Constructor</h2> <dl> - <dt><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/Set"><code>Set()</code></a></dt> + <dt><a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set/Set"><code>Set()</code></a></dt> <dd>创建一个新的<code>Set</code>对象。</dd> </dl> |