aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/navigatorid/appname/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/api/navigatorid/appname/index.html')
-rw-r--r--files/zh-cn/web/api/navigatorid/appname/index.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/navigatorid/appname/index.html b/files/zh-cn/web/api/navigatorid/appname/index.html
new file mode 100644
index 0000000000..389e0b367b
--- /dev/null
+++ b/files/zh-cn/web/api/navigatorid/appname/index.html
@@ -0,0 +1,37 @@
+---
+title: NavigatorID.appName
+slug: Web/API/NavigatorID/appName
+translation_of: Web/API/NavigatorID/appName
+---
+<p>{{ ApiRef() }}</p>
+
+<h2 id="Summary" name="Summary">概述</h2>
+
+<p>返回所使用浏览器的名称。由于兼容性问题,HTML5 规范允许该属性返回 "Netscape" 。</p>
+
+<div class="note"><strong>注意:</strong>该属性并不一定能返回正确的浏览器名称。在基于 Gecko 的浏览器 (例如 Firefox)和基于 WebKit 的浏览器(例如 Chrome 和 Safari)中,返回的浏览器名称都是 "Netscape".</div>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="eval">appName = window.navigator.appName
+</pre>
+
+<h3 id="Parameters" name="Parameters">返回值</h3>
+
+<ul>
+ <li><code>appName</code> 是一个字符串,表示浏览器名称</li>
+</ul>
+
+<h2 id="Example" name="Example">例子</h2>
+
+<pre class="brush: js">alert(window.navigator.appName);
+// 显示浏览器名称
+</pre>
+
+<h2 id="Specification" name="Specification">规范</h2>
+
+<ul>
+ <li><a class="external" href="http://www.w3.org/TR/html5/timers.html#navigator" title="http://www.w3.org/TR/html5/timers.html#navigator">HTML5: System state and capabilities: the Navigator object</a></li>
+</ul>
+
+<p>该属性起初属于 DOM Level 0 ,目前已经被添加到HTML5规范中。</p>