diff options
author | Florian Merz <me@fiji-flo.de> | 2021-02-05 18:52:37 +0100 |
---|---|---|
committer | Florian Merz <me@fiji-flo.de> | 2021-02-05 18:52:37 +0100 |
commit | 08a04d85393a0bb5721a17328df62c4915c487c5 (patch) | |
tree | ea226febdf775a158b9b110459697a090fdfbe8e /files/zh-cn/web/api/request | |
parent | 7425818d30fbc66df26cedebc612e8e83a332c56 (diff) | |
download | translated-content-08a04d85393a0bb5721a17328df62c4915c487c5.tar.gz translated-content-08a04d85393a0bb5721a17328df62c4915c487c5.tar.bz2 translated-content-08a04d85393a0bb5721a17328df62c4915c487c5.zip |
fix some macros for zh-cn
Diffstat (limited to 'files/zh-cn/web/api/request')
-rw-r--r-- | files/zh-cn/web/api/request/context/index.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/files/zh-cn/web/api/request/context/index.html b/files/zh-cn/web/api/request/context/index.html index c1ecbc28a0..98730ceb60 100644 --- a/files/zh-cn/web/api/request/context/index.html +++ b/files/zh-cn/web/api/request/context/index.html @@ -5,9 +5,9 @@ translation_of: Web/API/Request/context --- <div>{{APIRef("Fetch")}}{{deprecated_header()}}</div> -<p><span class="seoSummary">The deprecated </span><font><font>弃用</font></font><strong><code>context</code></strong><font><font>所述的只读属性{{domxref(“请求”)}}接口包含请求的上下文(例如,</font></font><code>audio</code><font><font>,</font></font><code>image</code><font><font>,</font></font><code>iframe</code><font><font>)。</font></font><font><font>这定义了要获取的资源类型。</font><font>它已由{{domxref(“ Request.destination”,“ destination”)}}属性取代。</font></font> This defines what sort of resource is being fetched. This has been replaced by the {{domxref("Request.destination", "destination")}} property.</p> +<p><span class="seoSummary">The deprecated </span><font><font>弃用</font></font><strong><code>context</code></strong><font><font>所述的只读属性{{domxref("请求")}}接口包含请求的上下文(例如,</font></font><code>audio</code><font><font>,</font></font><code>image</code><font><font>,</font></font><code>iframe</code><font><font>)。</font></font><font><font>这定义了要获取的资源类型。</font><font>它已由{{domxref("Request.destination”,“ destination")}}属性取代。</font></font> This defines what sort of resource is being fetched. This has been replaced by the {{domxref("Request.destination", "destination")}} property.</p> -<p>The context of a request is only relevant in the <font><font>请求的上下文仅与</font></font><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/API/ServiceWorker_API"><font><font>ServiceWorker API</font></font></a><font><font>相关</font><font>;</font><font>服务人员可以根据URL是用于图像还是可嵌入对象(例如{{htmlelement(“视频”)}},{{domxref(“ iframe”)}}等)进行决策。</font></font>; a service worker can make decisions based on whether the URL is for an image, or an embeddable object such as a {{htmlelement("video")}}, {{domxref("iframe")}}, etc.</p> +<p>The context of a request is only relevant in the <font><font>请求的上下文仅与</font></font><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/API/ServiceWorker_API"><font><font>ServiceWorker API</font></font></a><font><font>相关</font><font>;</font><font>服务人员可以根据URL是用于图像还是可嵌入对象(例如{{htmlelement("视频")}},{{domxref("iframe")}}等)进行决策。</font></font>; a service worker can make decisions based on whether the URL is for an image, or an embeddable object such as a {{htmlelement("video")}}, {{domxref("iframe")}}, etc.</p> <div class="note"> <p><strong>Note<font><font>注意</font></font></strong><font><font>:您可以在“ </font></font><a href="https://fetch.spec.whatwg.org/#concept-request-context"><font><font>获取规范请求上下文”</font></font></a><font><font>部分中</font><font>找到不同可用上下文的完整列表,包括关联的上下文框架类型,CSP指令和平台功能示例</font><font>。</font></font> section.</p> @@ -19,11 +19,11 @@ translation_of: Web/API/Request/context <h3 id="Value">Value</h3> -<p>A {{domxref("RequestContext")}} value.一个{{domxref(“ RequestContext”)}}值。</p> +<p>A {{domxref("RequestContext")}} value.一个{{domxref("RequestContext")}}值。</p> <h2 id="Example例子">Example<font><font>例子</font></font></h2> -<p>In the following snippet, we create a new request using the {{domxref("Request.Request()")}} constructor (for an image file in the same directory as the script), then save the request context in a variable:在以下代码段中,我们使用{{domxref(“ Request.Request()”)}}}构造函数创建一个新请求(用于与脚本位于同一目录中的图像文件),然后将请求上下文保存在变量中:</p> +<p>In the following snippet, we create a new request using the {{domxref("Request.Request()")}} constructor (for an image file in the same directory as the script), then save the request context in a variable:在以下代码段中,我们使用{{domxref("Request.Request()")}}}构造函数创建一个新请求(用于与脚本位于同一目录中的图像文件),然后将请求上下文保存在变量中:</p> <pre class="brush: js notranslate">var myRequest = new Request('flowers.jpg'); var myContext = myRequest.context; // returns the empty string by default</pre> |