aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/url/pathname
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/url/pathname
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/url/pathname')
-rw-r--r--files/zh-cn/web/api/url/pathname/index.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/url/pathname/index.html b/files/zh-cn/web/api/url/pathname/index.html
new file mode 100644
index 0000000000..cb761610f6
--- /dev/null
+++ b/files/zh-cn/web/api/url/pathname/index.html
@@ -0,0 +1,59 @@
+---
+title: URL.pathname
+slug: Web/API/URL/pathname
+tags:
+ - API
+ - URL
+ - pathname
+translation_of: Web/API/URL/pathname
+---
+<div>{{ApiRef("URL API")}}</div>
+
+<p>{{domxref("URL")}}接口的<strong><code>pathname</code></strong>属性是一个{{domxref("USVString")}},包含一个初始 <code>'/'</code> 和URL的路径(如果没有路径,则为空字符串)</p>
+
+<p>{{AvailableInWorkers}}</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><em>string</em> = <em>object</em>.pathname;
+<em>object</em>.pathname = <em>string</em>;
+</pre>
+
+<h3 id="值">值</h3>
+
+<p>一个{{domxref("USVString")}}.</p>
+
+<h2 id="例子">例子</h2>
+
+<pre class="brush: js">var url = new URL('https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname');
+var result = url.pathname; // Returns:"/en-US/docs/Web/API/URL/pathname"
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">说明</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('URL', '#dom-url-pathname', 'URL.pathname')}}</td>
+ <td>{{Spec2('URL')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div class="hidden">该页面上的兼容性表是由结构化数据生成的。如果您想对数据做出贡献,请查看https://github.com/mdn/browser-compat-data,并向我们发送一个pull request。</div>
+
+<p>{{Compat("api.URL.pathname")}}</p>
+
+<h2 id="参考">参考</h2>
+
+<ul>
+ <li>它所属的{{domxref("URL")}}接口。</li>
+</ul>