未验证 提交 ccb55b27 编写于 作者: O openharmony_ci 提交者: Gitee

!1352 【轻量级 PR】:update zh-cn/application-dev/reference/apis/js-apis-uri.md.

Merge pull request !1352 from zengyawen/N/A
......@@ -48,8 +48,10 @@ constructor是URI的构造函数。
- 示例:
```
var mm = 'http://username:password@host:8080/directory/file?foo=1&bar=2#fragment';
new URI(mm); // Output 'http://username:password@host:8080/directory/file?foo=1&bar=2#fragment';
new URI('http://username:password@host:8080'); // Output 'http://username:password@host:8080';
new uri.URI(mm); // Output 'http://username:password@host:8080/directory/file?foo=1&bar=2#fragment';
```
```
new uri.URI('http://username:password@host:8080'); // Output 'http://username:password@host:8080';
```
......@@ -66,7 +68,7 @@ toString(): string
- 示例:
```
const url = new URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
const url = new uri.URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
url.toString()
```
......@@ -89,9 +91,9 @@ equals(other: URI): boolean
- 示例:
```
const uri = new URI('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
const uri1 = new URI('http://username:password@host:8080/directory/file?query=pppppp#qwer=da#fragment');
uri.equals(uri1);
const uriInstance = new uri.URI('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
const uriInstance1 = new uri.URI('http://username:password@host:8080/directory/file?query=pppppp#qwer=da#fragment');
uriInstance.equals(uriInstance1);
```
......@@ -106,8 +108,8 @@ equals(other: URI): boolean
- 示例:
```
const uri = new URI('http://username:password@www.qwer.com:8080?query=pppppp');
uri.checkIsAbsolute();
const uriInstance = new uri.URI('http://username:password@www.qwer.com:8080?query=pppppp');
uriInstance.checkIsAbsolute();
```
......@@ -124,7 +126,7 @@ normalize(): URI
- 示例:
```
const uri = new URI('http://username:password@www.qwer.com:8080/path/path1/../path2/./path3?query=pppppp');
let uri1 = uri.normalize();
uri1.path;
const uriInstance = new uri.URI('http://username:password@www.qwer.com:8080/path/path1/../path2/./path3?query=pppppp');
let uriInstance1 = uriInstance.normalize();
uriInstance1.path;
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册