Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
c69c483d
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c69c483d
编写于
12月 16, 2022
作者:
Z
zengyawen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
zengyawen
<
zengyawen1@huawei.com
>
上级
0d62740a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
25 addition
and
25 deletion
+25
-25
zh-cn/application-dev/reference/apis/js-apis-uri.md
zh-cn/application-dev/reference/apis/js-apis-uri.md
+10
-10
zh-cn/application-dev/reference/apis/js-apis-url.md
zh-cn/application-dev/reference/apis/js-apis-url.md
+11
-11
zh-cn/application-dev/reference/apis/js-apis-xml.md
zh-cn/application-dev/reference/apis/js-apis-xml.md
+4
-4
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-uri.md
浏览文件 @
c69c483d
...
@@ -47,11 +47,11 @@ constructor是URI的构造函数。
...
@@ -47,11 +47,11 @@ constructor是URI的构造函数。
**示例:**
**示例:**
```
js
```
js
let
mm
=
'
http://username:password@host:8080/directory/file?foo=1&bar=2#fragment
'
;
let
mm
=
'
http
s
://username:password@host:8080/directory/file?foo=1&bar=2#fragment
'
;
new
uri
.
URI
(
mm
);
// Output 'http://username:password@host:8080/directory/file?foo=1&bar=2#fragment';
new
uri
.
URI
(
mm
);
// Output 'http
s
://username:password@host:8080/directory/file?foo=1&bar=2#fragment';
```
```
```
js
```
js
new
uri
.
URI
(
'
http
://username:password@host:8080
'
);
// Output 'http
://username:password@host:8080';
new
uri
.
URI
(
'
http
s://username:password@host:8080
'
);
// Output 'https
://username:password@host:8080';
```
```
...
@@ -72,7 +72,7 @@ toString(): string
...
@@ -72,7 +72,7 @@ toString(): string
**示例:**
**示例:**
```
js
```
js
const
result
=
new
uri
.
URI
(
'
http://username:password@host:8080/directory/file?query=pppppp#qwer=da
'
);
const
result
=
new
uri
.
URI
(
'
http
s
://username:password@host:8080/directory/file?query=pppppp#qwer=da
'
);
result
.
toString
()
result
.
toString
()
```
```
...
@@ -104,8 +104,8 @@ equals(other: URI): boolean
...
@@ -104,8 +104,8 @@ equals(other: URI): boolean
**示例:**
**示例:**
```
js
```
js
const
uriInstance
=
new
uri
.
URI
(
'
http://username:password@host:8080/directory/file?query=pppppp#qwer=da
'
);
const
uriInstance
=
new
uri
.
URI
(
'
http
s
://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
'
);
const
uriInstance1
=
new
uri
.
URI
(
'
http
s
://username:password@host:8080/directory/file?query=pppppp#qwer=da#fragment
'
);
uriInstance
.
equals
(
uriInstance1
);
uriInstance
.
equals
(
uriInstance1
);
```
```
### equalsTo<sup>9+</sup>
### equalsTo<sup>9+</sup>
...
@@ -131,8 +131,8 @@ equalsTo(other: URI): boolean
...
@@ -131,8 +131,8 @@ equalsTo(other: URI): boolean
**示例:**
**示例:**
```
js
```
js
const
uriInstance
=
new
uri
.
URI
(
'
http://username:password@host:8080/directory/file?query=pppppp#qwer=da
'
);
const
uriInstance
=
new
uri
.
URI
(
'
http
s
://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
'
);
const
uriInstance1
=
new
uri
.
URI
(
'
http
s
://username:password@host:8080/directory/file?query=pppppp#qwer=da#fragment
'
);
uriInstance
.
equalsTo
(
uriInstance1
);
uriInstance
.
equalsTo
(
uriInstance1
);
```
```
...
@@ -153,7 +153,7 @@ checkIsAbsolute(): boolean
...
@@ -153,7 +153,7 @@ checkIsAbsolute(): boolean
**示例:**
**示例:**
```
js
```
js
const
uriInstance
=
new
uri
.
URI
(
'
http://username:password@www.qwer.com:8080?query=pppppp
'
);
const
uriInstance
=
new
uri
.
URI
(
'
http
s
://username:password@www.qwer.com:8080?query=pppppp
'
);
uriInstance
.
checkIsAbsolute
();
uriInstance
.
checkIsAbsolute
();
```
```
...
@@ -175,7 +175,7 @@ normalize(): URI
...
@@ -175,7 +175,7 @@ normalize(): URI
**示例:**
**示例:**
```
js
```
js
const
uriInstance
=
new
uri
.
URI
(
'
http://username:password@www.qwer.com:8080/path/path1/../path2/./path3?query=pppppp
'
);
const
uriInstance
=
new
uri
.
URI
(
'
http
s
://username:password@www.qwer.com:8080/path/path1/../path2/./path3?query=pppppp
'
);
let
uriInstance1
=
uriInstance
.
normalize
();
let
uriInstance1
=
uriInstance
.
normalize
();
uriInstance1
.
path
;
uriInstance1
.
path
;
```
```
zh-cn/application-dev/reference/apis/js-apis-url.md
浏览文件 @
c69c483d
...
@@ -809,13 +809,13 @@ URL的构造函数。
...
@@ -809,13 +809,13 @@ URL的构造函数。
**示例:**
**示例:**
```
js
```
js
let
mm
=
'
http://username:password@host:8080
'
;
let
mm
=
'
http
s
://username:password@host:8080
'
;
let
a
=
new
Url
.
URL
(
"
/
"
,
mm
);
// Output 'http://username:password@host:8080/';
let
a
=
new
Url
.
URL
(
"
/
"
,
mm
);
// Output 'http
s
://username:password@host:8080/';
let
b
=
new
Url
.
URL
(
mm
);
// Output 'http://username:password@host:8080/';
let
b
=
new
Url
.
URL
(
mm
);
// Output 'http
s
://username:password@host:8080/';
new
Url
.
URL
(
'
path/path1
'
,
b
);
// Output 'http://username:password@host:8080/path/path1';
new
Url
.
URL
(
'
path/path1
'
,
b
);
// Output 'http
s
://username:password@host:8080/path/path1';
let
c
=
new
Url
.
URL
(
'
/path/path1
'
,
b
);
// Output 'http://username:password@host:8080/path/path1';
let
c
=
new
Url
.
URL
(
'
/path/path1
'
,
b
);
// Output 'http
s
://username:password@host:8080/path/path1';
new
Url
.
URL
(
'
/path/path1
'
,
c
);
// Output 'http://username:password@host:8080/path/path1';
new
Url
.
URL
(
'
/path/path1
'
,
c
);
// Output 'http
s
://username:password@host:8080/path/path1';
new
Url
.
URL
(
'
/path/path1
'
,
a
);
// Output 'http://username:password@host:8080/path/path1';
new
Url
.
URL
(
'
/path/path1
'
,
a
);
// Output 'http
s
://username:password@host:8080/path/path1';
new
Url
.
URL
(
'
/path/path1
'
,
"
https://www.exampleUrl/fr-FR/toto
"
);
// Output https://www.exampleUrl/path/path1
new
Url
.
URL
(
'
/path/path1
'
,
"
https://www.exampleUrl/fr-FR/toto
"
);
// Output https://www.exampleUrl/path/path1
new
Url
.
URL
(
'
/path/path1
'
,
''
);
// Raises a TypeError exception as '' is not a valid URL
new
Url
.
URL
(
'
/path/path1
'
,
''
);
// Raises a TypeError exception as '' is not a valid URL
new
Url
.
URL
(
'
/path/path1
'
);
// Raises a TypeError exception as '/path/path1' is not a valid URL
new
Url
.
URL
(
'
/path/path1
'
);
// Raises a TypeError exception as '/path/path1' is not a valid URL
...
@@ -841,8 +841,8 @@ URL静态成员函数。
...
@@ -841,8 +841,8 @@ URL静态成员函数。
**示例:**
**示例:**
```
js
```
js
let
mm
=
'
http://username:password@host:8080
'
;
let
mm
=
'
http
s
://username:password@host:8080
'
;
Url
.
URL
.
parseURL
(
mm
);
// Output 'http://username:password@host:8080/';
Url
.
URL
.
parseURL
(
mm
);
// Output 'http
s
://username:password@host:8080/';
```
```
### tostring
### tostring
...
@@ -862,7 +862,7 @@ toString(): string
...
@@ -862,7 +862,7 @@ toString(): string
**示例:**
**示例:**
```
js
```
js
const
url
=
new
Url
.
URL
(
'
http://username:password@host:8080/directory/file?query=pppppp#qwer=da
'
);
const
url
=
new
Url
.
URL
(
'
http
s
://username:password@host:8080/directory/file?query=pppppp#qwer=da
'
);
url
.
toString
();
url
.
toString
();
```
```
...
@@ -883,7 +883,7 @@ toJSON(): string
...
@@ -883,7 +883,7 @@ toJSON(): string
**示例:**
**示例:**
```
js
```
js
const
url
=
new
Url
.
URL
(
'
http://username:password@host:8080/directory/file?query=pppppp#qwer=da
'
);
const
url
=
new
Url
.
URL
(
'
http
s
://username:password@host:8080/directory/file?query=pppppp#qwer=da
'
);
url
.
toJSON
();
url
.
toJSON
();
```
```
<!--no_check-->
<!--no_check-->
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-xml.md
浏览文件 @
c69c483d
...
@@ -144,11 +144,11 @@ endElement(): void
...
@@ -144,11 +144,11 @@ endElement(): void
let
arrayBuffer
=
new
ArrayBuffer
(
1024
);
let
arrayBuffer
=
new
ArrayBuffer
(
1024
);
let
bufView
=
new
DataView
(
arrayBuffer
);
let
bufView
=
new
DataView
(
arrayBuffer
);
let
thatSer
=
new
xml
.
XmlSerializer
(
bufView
);
let
thatSer
=
new
xml
.
XmlSerializer
(
bufView
);
thatSer
.
setNamespace
(
"
h
"
,
"
http://www.w3.org/TR/html4/
"
);
thatSer
.
setNamespace
(
"
h
"
,
"
http
s
://www.w3.org/TR/html4/
"
);
thatSer
.
startElement
(
"
table
"
);
thatSer
.
startElement
(
"
table
"
);
thatSer
.
setAttributes
(
"
importance
"
,
"
high
"
);
thatSer
.
setAttributes
(
"
importance
"
,
"
high
"
);
thatSer
.
setText
(
"
Happy
"
);
thatSer
.
setText
(
"
Happy
"
);
thatSer
.
endElement
();
// => <h:table importance="high" xmlns:h="http://www.w3.org/TR/html4/">Happy</h:table>
thatSer
.
endElement
();
// => <h:table importance="high" xmlns:h="http
s
://www.w3.org/TR/html4/">Happy</h:table>
```
```
...
@@ -173,9 +173,9 @@ setNamespace(prefix: string, namespace: string): void
...
@@ -173,9 +173,9 @@ setNamespace(prefix: string, namespace: string): void
let
arrayBuffer
=
new
ArrayBuffer
(
1024
);
let
arrayBuffer
=
new
ArrayBuffer
(
1024
);
let
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
let
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
setDeclaration
();
thatSer
.
setDeclaration
();
thatSer
.
setNamespace
(
"
h
"
,
"
http://www.w3.org/TR/html4/
"
);
thatSer
.
setNamespace
(
"
h
"
,
"
http
s
://www.w3.org/TR/html4/
"
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
endElement
();
// = >'<?xml version="1.0" encoding="utf-8"?>\r\n<h:note xmlns:h="http://www.w3.org/TR/html4/"/>';
thatSer
.
endElement
();
// = >'<?xml version="1.0" encoding="utf-8"?>\r\n<h:note xmlns:h="http
s
://www.w3.org/TR/html4/"/>';
```
```
### setComment
### setComment
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录