未验证 提交 61672d73 编写于 作者: J jiangkai43 提交者: Gitee

修改parseURL示例代码

Signed-off-by: Njiangkai43 <jiangkai43@huawei.com>
上级 35a66ee1
...@@ -450,7 +450,8 @@ URL静态成员函数。 ...@@ -450,7 +450,8 @@ URL静态成员函数。
```js ```js
let mm = 'https://username:password@host:8080'; let mm = 'https://username:password@host:8080';
Url.URL.parseURL(mm); // Output 'https://username:password@host:8080/'; let url = Url.URL.parseURL(mm);
url.toString(); // Output 'https://username:password@host:8080/';
``` ```
### tostring ### tostring
...@@ -668,9 +669,9 @@ forEach(callbackFn: (value: string, key: string, searchParams: this) => void, th ...@@ -668,9 +669,9 @@ forEach(callbackFn: (value: string, key: string, searchParams: this) => void, th
**示例:** **示例:**
```js ```js
const myURLObject = Url.URL.parseURL('https://developer.exampleUrl/?fod=1&bard=2'); const myURLObject = new Url.URL('https://developer.exampleUrl/?fod=1&bard=2');
myURLObject.params.forEach((value, name, searchParams) => { myURLObject.searchParams.forEach((value, name, searchParams) => {
console.log(name, value, myURLObject.params === searchParams); console.log(name, value, myURLObject.searchParams === searchParams);
}); });
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册