aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/element/noscript/index.html
blob: 295bff18ef816bd781b27996c7d606a6b93b9eac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
title: <noscript>
slug: Web/HTML/Element/noscript
tags:
  - <noscript>
translation_of: Web/HTML/Element/noscript
---
<div>{{HTMLRef}}</div>

<p>如果页面上的脚本类型不受支持或者当前在浏览器中关闭了脚本,则在 <strong>HTML &lt;noscript&gt; 元素</strong>中定义脚本未被执行时的替代内容。</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row"><a href="/en-US/docs/HTML/Content_categories" title="HTML/Content_categories">内容分类</a></th>
   <td><a href="/en-US/docs/HTML/Content_categories#Metadata_content" title="HTML/Content_categories#Metadata_content">Metadata content</a>, <a href="/en-US/docs/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">flow content</a>, <a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content categories#Phrasing content">phrasing content</a>.</td>
  </tr>
  <tr>
   <th scope="row">允许的内容</th>
   <td>
    <p>当脚本被禁用并且它是 {{HTMLElement("head")}}元素的后代时:以下顺序任意,零个或者多个{{HTMLElement("link")}}元素,零个或者多个{{HTMLElement("style")}}元素,零个或者多个{{HTMLElement("meta")}}元素。</p>

    <p>当脚本被禁用并且它不是 {{HTMLElement("head")}} 元素的子元素时:任何transparent content 都可以,但是在它的后代中必须没有 <code>&lt;noscript&gt;</code>元素。</p>

    <p>否则:flow content 或 phrasing content 。</p>
   </td>
  </tr>
  <tr>
   <th scope="row">标签省略</th>
   <td>
    <p>不允许,开始标签和结束标签都不能省略。</p>
   </td>
  </tr>
  <tr>
   <th scope="row">允许的父元素</th>
   <td>
    <p>如果没有根元素 <code>&lt;noscript&gt;</code>,或者在{{HTMLElement("head")}}元素中(仅用于HTML文档)也没有根元素 <code>&lt;noscript&gt;</code>,允许任何 <a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Phrasing_content">phrasing content</a> 元素。</p>
   </td>
  </tr>
  <tr>
   <th scope="row">DOM接口</th>
   <td>{{domxref("HTMLElement")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="属性">属性</h2>

<p><span style="line-height: 21px;">该元素只包含 </span><a href="https://developer.mozilla.org/en-US/docs/HTML/Global_attributes" style="line-height: 21px;" title="HTML/Global attributes">全局属性</a><span style="line-height: 21px;">.</span></p>

<h2 id="示例">示例</h2>

<pre class="brush: html">&lt;noscript&gt;
  &lt;!-- anchor linking to external file --&gt;
  &lt;a href="http://www.mozilla.com/"&gt;External Link&lt;/a&gt;
&lt;/noscript&gt;
&lt;p&gt;Rocks!&lt;/p&gt;
</pre>

<h3 id="允许脚本时的结果">允许脚本时的结果</h3>

<p>Rocks!</p>

<h3 id="禁用脚本时的结果">禁用脚本时的结果</h3>

<p><a class="external" href="http://www.mozilla.com/">External Link</a></p>

<p>Rocks!</p>

<h2 id="Specifications" name="Specifications"><font>规范</font></h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG', 'scripting-1.html#the-noscript-element', '&lt;noscript&gt;')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td></td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'scripting-1.html#the-noscript-element', '&lt;noscript&gt;')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td></td>
  </tr>
  <tr>
   <td>{{SpecName('HTML4.01', 'interact/scripts.html#h-18.3.1', '&lt;noscript&gt;')}}</td>
   <td>{{Spec2('HTML4.01')}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性"><font>浏览器兼容性</font></h2>

<p>{{Compat("html.elements.noscript")}}</p>