diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/promise')
6 files changed, 2 insertions, 12 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/promise/all/index.html b/files/zh-cn/web/javascript/reference/global_objects/promise/all/index.html index 113760c25d..6ba1063df7 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/promise/all/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/promise/all/index.html @@ -17,8 +17,6 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Promise/all <div>{{EmbedInteractiveExample("pages/js/promise-all.html")}}</div> -<p class="hidden">The source for this interactive demo is stored in a GitHub repository. If you'd like to contribute to the interactive demo project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p> - <h2 id="语法">语法</h2> <pre class="syntaxbox"><var>Promise.all(iterable)</var>;</pre> diff --git a/files/zh-cn/web/javascript/reference/global_objects/promise/index.html b/files/zh-cn/web/javascript/reference/global_objects/promise/index.html index 418851f99a..5a5fd2d613 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/promise/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/promise/index.html @@ -196,7 +196,7 @@ myFirstPromise.then(function(successMessage){ <h3 id="高级示例">高级示例</h3> -<pre class="brush: html hidden"><button id="btn">Make a promise!</button> +<pre class="brush: html"><button id="btn">Make a promise!</button> <div id="log"></div> </pre> @@ -247,7 +247,7 @@ function testPromise() { ') Promise made (<small>同步代码结束</small>)<br/>'); }</pre> -<pre class="brush:js hidden">if ("Promise" in window) { +<pre class="brush:js">if ("Promise" in window) { let btn = document.getElementById("btn"); btn.addEventListener("click",testPromise); } else { diff --git a/files/zh-cn/web/javascript/reference/global_objects/promise/promise/index.html b/files/zh-cn/web/javascript/reference/global_objects/promise/promise/index.html index 4af6e48f93..1f4a6d5762 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/promise/promise/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/promise/promise/index.html @@ -9,8 +9,6 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Promise/Promise <div>{{EmbedInteractiveExample("pages/js/promise-constructor.html")}}</div> -<p class="hidden">交互式的demo的源码在GitHub仓库,如果你乐于为交互式的demo做贡献,请克隆<a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a>并提交pull request .</p> - <h2 id="语法">语法</h2> <pre class="syntaxbox">new Promise(<var>executor</var>)</pre> diff --git a/files/zh-cn/web/javascript/reference/global_objects/promise/race/index.html b/files/zh-cn/web/javascript/reference/global_objects/promise/race/index.html index 569f7d9d50..674d97f5e1 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/promise/race/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/promise/race/index.html @@ -11,8 +11,6 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Promise/race <div>{{EmbedInteractiveExample("pages/js/promise-race.html")}}</div> -<p class="hidden">The source for this interactive demo is stored in a GitHub repository. If you'd like to contribute to the interactive demo project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p> - <h2 id="Syntax" name="Syntax">语法</h2> <pre class="syntaxbox"><var>Promise.race(iterable)</var>;</pre> diff --git a/files/zh-cn/web/javascript/reference/global_objects/promise/resolve/index.html b/files/zh-cn/web/javascript/reference/global_objects/promise/resolve/index.html index ee41e7d824..e25c58139a 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/promise/resolve/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/promise/resolve/index.html @@ -31,8 +31,6 @@ Promise.resolve(thenable) //这会造成一个死循环 <div>{{EmbedInteractiveExample("pages/js/promise-resolve.html")}}</div> -<p class="hidden">The source for this interactive demo is stored in a GitHub repository. If you'd like to contribute to the interactive demo project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p> - <h2 id="Syntax" name="Syntax">语法</h2> <pre class="syntaxbox"><var>Promise.resolve(value)</var>; diff --git a/files/zh-cn/web/javascript/reference/global_objects/promise/then/index.html b/files/zh-cn/web/javascript/reference/global_objects/promise/then/index.html index d5193c8498..6717a21da3 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/promise/then/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/promise/then/index.html @@ -15,8 +15,6 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Promise/then <div>{{EmbedInteractiveExample("pages/js/promise-then.html")}}</div> -<p class="hidden">The source for this interactive demo is stored in a GitHub repository. If you'd like to contribute to the interactive demo project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p> - <div class="note"> <p>注意:如果忽略针对某个状态的回调函数参数,或者提供非函数 (nonfunction) 参数,那么 <code>then</code> 方法将会丢失关于该状态的回调函数信息,但是并不会产生错误。如果调用 <code>then</code> 的 <code>Promise</code> 的状态(fulfillment 或 rejection)发生改变,但是 <code>then</code> 中并没有关于这种状态的回调函数,那么 <code>then</code> 将创建一个没有经过回调函数处理的新 <code>Promise</code> 对象,这个新 <code>Promise</code> 只是简单地接受调用这个 <code>then</code> 的原 <code>Promise</code> 的终态作为它的终态。</p> </div> |
