提交 52d88c79 编写于 作者: L lixingyang-li 提交者: lixingyang

Modify the sample code language tag type for language compilation runtime

Signed-off-by: Nlixingyang-li <lixingyang8@huawei.com>
https://gitee.com/openharmony/docs/issues/I550NM
上级 faa43270
......@@ -39,7 +39,7 @@ Converts an XML text into a JavaScript object.
- Example
```
```js
let xml =
'<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' +
......
......@@ -60,7 +60,7 @@ Waits until the child process ends. This method uses a promise to return the exi
**Example**
```
```js
var child = process.runCmd('ls');
var result = child.wait();
result.then(val=>{
......@@ -85,7 +85,7 @@ Obtains the standard output of the child process.
**Example**
```
```js
var child = process.runCmd('ls');
var result = child.wait();
child.getOutput.then(val=>{
......@@ -110,7 +110,7 @@ Obtains the standard error output of the child process.
**Example**
```
```js
var child = process.runCmd('madir test.text');
var result = child.wait();
child.getErrorOutput.then(val=>{
......@@ -129,7 +129,7 @@ Closes the child process in running.
**Example**
```
```js
var child = process.runCmd('sleep 5; ls');
child.close();
```
......@@ -151,7 +151,7 @@ Sends a signal to the specified child process to terminate it.
**Example**
```
```js
var child = process.runCmd('sleep 5; ls');
child.kill(9);
```
......@@ -173,7 +173,7 @@ Checks whether this process is isolated.
**Example**
```
```js
var result = process.isIsolatedProcess();
```
......@@ -200,7 +200,7 @@ Checks whether a UID belongs to this app.
**Example**
```
```js
var result = process.isAppUid(688);
```
......@@ -221,7 +221,7 @@ Checks whether this process is running in a 64-bit environment.
**Example**
```
```js
var ressult = process.is64Bit();
```
......@@ -248,7 +248,7 @@ Obtains the process UID based on the process name.
**Example**
```
```js
var pres = process.getUidForName("tool")
```
......@@ -275,7 +275,7 @@ Obtains the thread priority based on the specified TID.
**Example**
```
```js
var tid = process.getTid();
var pres = process.getThreadPriority(tid);
```
......@@ -297,7 +297,7 @@ Obtains the duration, in milliseconds, from the time the system starts to the ti
**Example**
```
```js
var realtime = process.getStartRealtime();
```
......@@ -317,7 +317,7 @@ Obtains the CPU time (in milliseconds) from the time the process starts to the c
**Example**
```
```js
var result = process.getPastCpuTime() ;
```
......@@ -344,7 +344,7 @@ Obtains the system configuration.
**Example**
```
```js
var _SC_ARG_MAX = 0
var pres = process.getSystemConfig(_SC_ARG_MAX)
```
......@@ -372,7 +372,7 @@ Obtains the value of an environment variable.
**Example**
```
```js
var pres = process.getEnvironmentVar("PATH")
```
......@@ -408,7 +408,7 @@ Forks a new process to run a shell command and returns the **ChildProcess** obje
**Example**
```
```js
var child = process.runCmd('ls', { maxBuffer : 2 });
var result = child.wait();
child.getOutput.then(val=>{
......@@ -427,7 +427,7 @@ Aborts a process and generates a core file. This method will cause a process to
**Example**
```
```js
process.abort();
```
......@@ -455,7 +455,7 @@ Stores the events triggered by the user.
**Example**
```
```js
process.on("data", (e)=>{
console.log("data callback");
})
......@@ -484,7 +484,7 @@ Deletes the event stored by the user.
**Example**
```
```js
process.on("data", (e)=>{
console.log("data callback");
})
......@@ -510,7 +510,7 @@ Exercise caution when using this API.
**Example**
```
```js
process.exit(0);
```
......@@ -525,7 +525,7 @@ Obtains the working directory of this process.
**Example**
```
```js
var path = process.cwd();
```
......@@ -546,7 +546,7 @@ Changes the working directory of this process.
**Example**
```
```js
process.chdir('/system');
```
......@@ -567,7 +567,7 @@ Obtains the running time of this process.
**Example**
```
```js
var time = process.uptime();
```
......@@ -594,7 +594,7 @@ Sends a signal to the specified process to terminate it.
| boolean | Returns **true** if the signal is sent successfully; returns **false** otherwise.|
**Example**
```
```js
var pres = process.pid
var result = that.kill(pres, 28)
```
......@@ -46,11 +46,11 @@ A constructor used to create a URI instance.
**Example**
```
```js
var mm = 'http://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';
```
```
```js
new uri.URI('http://username:password@host:8080'); // Output 'http://username:password@host:8080';
```
......@@ -69,7 +69,7 @@ Obtains the query string applicable to this URL.
**Example**
```
```js
const url = new uri.URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
url.toString()
```
......@@ -95,7 +95,7 @@ Checks whether this URI is the same as another URI object.
**Example**
```
```js
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);
......@@ -115,7 +115,7 @@ Checks whether this URI is an absolute URI (whether the scheme component is defi
**Example**
```
```js
const uriInstance = new uri.URI('http://username:password@www.qwer.com:8080?query=pppppp');
uriInstance.checkIsAbsolute();
```
......@@ -134,7 +134,7 @@ Normalizes the path of this URI.
| URI | URI with the normalized path.|
**Example**
```
```js
const uriInstance = new uri.URI('http://username:password@www.qwer.com:8080/path/path1/../path2/./path3?query=pppppp');
let uriInstance1 = uriInstance.normalize();
uriInstance1.path;
......
......@@ -31,7 +31,7 @@ Creates a **URLSearchParams** instance.
**Example**
```
```js
var objectParams = new URLSearchParams([ ['user1', 'abc1'], ['query2', 'first2'], ['query3', 'second3'] ]);
var objectParams1 = new URLSearchParams({"fod" : 1 , "bard" : 2});
var objectParams2 = new URLSearchParams('?fod=1&bard=2');
......@@ -55,7 +55,7 @@ Appends a key-value pair into the query string.
**Example**
```
```js
let urlObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new URLSearchParams(urlObject.search.slice(1));
paramsObject.append('fod', 3);
......@@ -76,7 +76,7 @@ Deletes key-value pairs of the specified key.
**Example**
```
```js
let urlObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsobject = new URLSearchParams(urlObject.search.slice(1));
paramsobject.delete('fod');
......@@ -103,7 +103,7 @@ Obtains all the key-value pairs based on the specified key.
**Example**
```
```js
let urlObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new URLSearchParams(urlObject.search.slice(1));
paramsObject.append('fod', 3); // Add a second value for the fod parameter.
......@@ -125,7 +125,7 @@ Obtains an ES6 iterator. Each item of the iterator is a JavaScript array, and th
**Example**
```
```js
var searchParamsObject = new URLSearchParams("keyName1=valueName1&keyName2=valueName2");
for (var pair of searchParamsObject .entries()) { // Show keyName/valueName pairs
console.log(pair[0]+ ', '+ pair[1]);
......@@ -156,7 +156,7 @@ Traverses the key-value pairs in the **URLSearchParams** instance by using a cal
**Example**
```
```js
const myURLObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
myURLObject.searchParams.forEach((value, name, searchParams) => {
console.log(name, value, myURLObject.searchParams === searchParams);
......@@ -185,7 +185,7 @@ Obtains the value of the first key-value pair based on the specified key.
**Example**
```
```js
var paramsOject = new URLSearchParams(document.location.search.substring(1));
var name = paramsOject.get("name"); // is the string "Jonathan"
var age = parseInt(paramsOject.get("age"), 10); // is the number 18
......@@ -213,7 +213,7 @@ Checks whether a key has a value.
**Example**
```
```js
let urlObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new URLSearchParams(urlObject.search.slice(1));
paramsObject.has('bard') === true;
......@@ -235,7 +235,7 @@ Sets the value for a key. If key-value pairs matching the specified key exist, t
**Example**
```
```js
let urlObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new URLSearchParams(urlObject.search.slice(1));
paramsObject.set('baz', 3); // Add a third parameter.
......@@ -251,7 +251,7 @@ Sorts all key-value pairs contained in this object based on the Unicode code poi
**Example**
```
```js
var searchParamsObject = new URLSearchParams("c=3&a=9&b=4&d=2"); // Create a test URLSearchParams object
searchParamsObject.sort(); // Sort the key/value pairs
console.log(searchParamsObject.toString()); // Display the sorted query string // Output a=9&b=2&c=3&d=4
......@@ -273,7 +273,7 @@ Obtains an ES6 iterator that contains the keys of all the key-value pairs.
**Example**
```
```js
var searchParamsObject = new URLSearchParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing
for (var key of searchParamsObject .keys()) { // Output key-value pairs
console.log(key);
......@@ -295,7 +295,7 @@ Obtains an ES6 iterator that contains the values of all the key-value pairs.
**Example**
```
```js
var searchParams = new URLSearchParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing
for (var value of searchParams.values()) {
console.log(value);
......@@ -318,7 +318,7 @@ Obtains an ES6 iterator. Each item of the iterator is a JavaScript array, and th
**Example**
```
```js
const paramsObject = new URLSearchParams('fod=bay&edg=bap');
for (const [name, value] of paramsObject) {
console.log(name, value);
......@@ -341,7 +341,7 @@ Obtains search parameters that are serialized as a string and, if necessary, per
**Example**
```
```js
let url = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let params = new URLSearchParams(url.search.slice(1));
params.append('fod', 3);
......@@ -386,7 +386,7 @@ Creates a URL.
**Example**
```
```js
var mm = 'http://username:password@host:8080';
var a = new URL("/", mm); // Output 'http://username:password@host:8080/';
var b = new URL(mm); // Output 'http://username:password@host:8080/';
......@@ -416,7 +416,7 @@ Converts the parsed URL into a string.
**Example**
```
```js
const url = new URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
url.toString()
```
......@@ -436,7 +436,7 @@ Converts the parsed URL into a JSON string.
| string | Website address in a serialized string.|
**Example**
```
```js
const url = new URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
url.toJSON()
```
......@@ -32,7 +32,7 @@ A constructor used to create an **XmlSerializer** instance.
**Example**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var bufView = new DataView(arrayBuffer);
var thatSer = new xml.XmlSerializer(bufView);
......@@ -54,7 +54,7 @@ Sets an attribute.
**Example**
```
```js
var thatSer = new xml.XmlSerializer(bufView);
thatSer.setAttributes("importance", "high");
```
......@@ -74,8 +74,8 @@ Adds an empty element.
**Example**
```
var thatSer = new xml.XmlSerializer(bufView);
```js
var thatSer = new xml.XmlSerializer(bufView);
thatSer.addEmptyElement("b"); // => <b/>
```
......@@ -88,7 +88,7 @@ Sets a declaration.
**Example**
```
```js
var thatSer = new xml.XmlSerializer(bufView);
thatSer.setDeclaration() // => <?xml version="1.0" encoding="utf-8"?>;
```
......@@ -108,7 +108,7 @@ Writes the start tag based on the given element name.
**Example**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("notel");
......@@ -124,7 +124,7 @@ Writes the end tag of the element.
**Example**
```
```js
var thatSer = new xml.XmlSerializer(bufView);
thatSer.setNamespace("h", "http://www.w3.org/TR/html4/");
thatSer.startElement("table");
......@@ -149,7 +149,7 @@ Sets the namespace for an element tag.
**Example**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDeclaration();
......@@ -172,7 +172,7 @@ Sets the comment.
**Example**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note");
......@@ -195,7 +195,7 @@ Sets CDATA attributes.
**Example**
```
```js
var arrayBuffer = new ArrayBuffer(1028);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setCDATA('root SYSTEM') // => '<![CDATA[root SYSTEM]]>';
......@@ -216,7 +216,7 @@ Sets **Text**.
**Example**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note");
......@@ -240,7 +240,7 @@ Sets **DocType**.
**Example**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDocType('root SYSTEM'); // => '<!DOCTYPE root SYSTEM>';
......@@ -265,7 +265,7 @@ Creates and returns an **XmlPullParser** object. The **XmlPullParser** object pa
**Example**
```
```js
var strXml =
'<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' +
......@@ -297,7 +297,7 @@ Parses XML information.
**Example**
```
```js
var strXml =
'<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' +
......
......@@ -39,7 +39,7 @@ convert(xml: string, options?: ConvertOptions) : Object
- 示例:
```
```js
let xml =
'<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' +
......
......@@ -60,7 +60,7 @@ wait(): Promise&lt;number&gt;
**示例:**
```
```js
var child = process.runCmd('ls');
var result = child.wait();
result.then(val=>{
......@@ -85,7 +85,7 @@ getOutput(): Promise&lt;Uint8Array&gt;
**示例:**
```
```js
var child = process.runCmd('ls');
var result = child.wait();
child.getOutput.then(val=>{
......@@ -110,7 +110,7 @@ getErrorOutput(): Promise&lt;Uint8Array&gt;
**示例:**
```
```js
var child = process.runCmd('madir test.text');
var result = child.wait();
child.getErrorOutput.then(val=>{
......@@ -129,7 +129,7 @@ close(): void
**示例:**
```
```js
var child = process.runCmd('sleep 5; ls');
child.close();
```
......@@ -151,7 +151,7 @@ kill(signal: number | string): void
**示例:**
```
```js
var child = process.runCmd('sleep 5; ls');
child.kill(9);
```
......@@ -173,7 +173,7 @@ isIsolatedProcess(): boolean
**示例:**
```
```js
var result = process.isIsolatedProcess();
```
......@@ -200,7 +200,7 @@ isAppUid(v: number): boolean
**示例:**
```
```js
var result = process.isAppUid(688);
```
......@@ -221,7 +221,7 @@ is64Bit(): boolean
**示例:**
```
```js
var ressult = process.is64Bit();
```
......@@ -248,7 +248,7 @@ getUidForName(v: string): number
**示例:**
```
```js
var pres = process.getUidForName("tool")
```
......@@ -275,7 +275,7 @@ getThreadPriority(v: number): number
**示例:**
```
```js
var tid = process.getTid();
var pres = process.getThreadPriority(tid);
```
......@@ -297,7 +297,7 @@ getStartRealtime(): number
**示例:**
```
```js
var realtime = process.getStartRealtime();
```
......@@ -317,7 +317,7 @@ getPastCpuTime(): number
**示例:**
```
```js
var result = process.getPastCpuTime() ;
```
......@@ -344,7 +344,7 @@ getSystemConfig(name: number): number
**示例:**
```
```js
var _SC_ARG_MAX = 0
var pres = process.getSystemConfig(_SC_ARG_MAX)
```
......@@ -372,7 +372,7 @@ getEnvironmentVar(name: string): string
**示例:**
```
```js
var pres = process.getEnvironmentVar("PATH")
```
......@@ -408,7 +408,7 @@ runCmd(command: string, options?: { timeout : number, killSignal : number | stri
**示例:**
```
```js
var child = process.runCmd('ls', { maxBuffer : 2 });
var result = child.wait();
child.getOutput.then(val=>{
......@@ -427,7 +427,7 @@ abort(): void
**示例:**
```
```js
process.abort();
```
......@@ -455,7 +455,7 @@ on(type: string, listener: EventListener): void
**示例:**
```
```js
process.on("data", (e)=>{
console.log("data callback");
})
......@@ -484,7 +484,7 @@ off(type: string): boolean
**示例:**
```
```js
process.on("data", (e)=>{
console.log("data callback");
})
......@@ -510,7 +510,7 @@ exit(code: number): void
**示例:**
```
```js
process.exit(0);
```
......@@ -525,7 +525,7 @@ cwd(): string
**示例:**
```
```js
var path = process.cwd();
```
......@@ -546,7 +546,7 @@ chdir(dir: string): void
**示例:**
```
```js
process.chdir('/system');
```
......@@ -567,7 +567,7 @@ uptime(): number
**示例:**
```
```js
var time = process.uptime();
```
......@@ -594,7 +594,8 @@ kill(signal: number, pid: number): boolean
| boolean | 信号是否发送成功。 |
**示例:**
```
```js
var pres = process.pid
var result = that.kill(pres, 28)
```
......@@ -46,11 +46,11 @@ constructor是URI的构造函数。
**示例:**
```
```js
var mm = 'http://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';
```
```
```js
new uri.URI('http://username:password@host:8080'); // Output 'http://username:password@host:8080';
```
......@@ -69,7 +69,7 @@ toString(): string
**示例:**
```
```js
const url = new uri.URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
url.toString()
```
......@@ -95,7 +95,7 @@ equals(other: URI): boolean
**示例:**
```
```js
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);
......@@ -115,7 +115,7 @@ checkIsAbsolute(): boolean
**示例:**
```
```js
const uriInstance = new uri.URI('http://username:password@www.qwer.com:8080?query=pppppp');
uriInstance.checkIsAbsolute();
```
......@@ -134,7 +134,7 @@ normalize(): URI
| URI | 返回一个path被规范化后的URI对象。 |
**示例:**
```
```js
const uriInstance = new uri.URI('http://username:password@www.qwer.com:8080/path/path1/../path2/./path3?query=pppppp');
let uriInstance1 = uriInstance.normalize();
uriInstance1.path;
......
......@@ -31,7 +31,7 @@ URLSearchParams的构造函数。
**示例:**
```
```js
var objectParams = new URLSearchParams([ ['user1', 'abc1'], ['query2', 'first2'], ['query3', 'second3'] ]);
var objectParams1 = new URLSearchParams({"fod" : 1 , "bard" : 2});
var objectParams2 = new URLSearchParams('?fod=1&bard=2');
......@@ -55,7 +55,7 @@ append(name: string, value: string): void
**示例:**
```
```js
let urlObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new URLSearchParams(urlObject.search.slice(1));
paramsObject.append('fod', 3);
......@@ -76,7 +76,7 @@ delete(name: string): void
**示例:**
```
```js
let urlObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsobject = new URLSearchParams(urlObject.search.slice(1));
paramsobject.delete('fod');
......@@ -103,7 +103,7 @@ getAll(name: string): string[]
**示例:**
```
```js
let urlObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new URLSearchParams(urlObject.search.slice(1));
paramsObject.append('fod', 3); // Add a second value for the fod parameter.
......@@ -125,7 +125,7 @@ entries(): IterableIterator<[string, string]>
**示例:**
```
```js
var searchParamsObject = new URLSearchParams("keyName1=valueName1&keyName2=valueName2");
for (var pair of searchParamsObject .entries()) { // Show keyName/valueName pairs
console.log(pair[0]+ ', '+ pair[1]);
......@@ -156,7 +156,7 @@ forEach(callbackfn: (value: string, key: string, searchParams: this) => void, th
**示例:**
```
```js
const myURLObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
myURLObject.searchParams.forEach((value, name, searchParams) => {
console.log(name, value, myURLObject.searchParams === searchParams);
......@@ -185,7 +185,7 @@ get(name: string): string | null
**示例:**
```
```js
var paramsOject = new URLSearchParams(document.location.search.substring(1));
var name = paramsOject.get("name"); // is the string "Jonathan"
var age = parseInt(paramsOject.get("age"), 10); // is the number 18
......@@ -213,7 +213,7 @@ has(name: string): boolean
**示例:**
```
```js
let urlObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new URLSearchParams(urlObject.search.slice(1));
paramsObject.has('bard') === true;
......@@ -235,7 +235,7 @@ set(name: string, value: string): void
**示例:**
```
```js
let urlObject = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new URLSearchParams(urlObject.search.slice(1));
paramsObject.set('baz', 3); // Add a third parameter.
......@@ -251,7 +251,7 @@ sort(): void
**示例:**
```
```js
var searchParamsObject = new URLSearchParams("c=3&a=9&b=4&d=2"); // Create a test URLSearchParams object
searchParamsObject.sort(); // Sort the key/value pairs
console.log(searchParamsObject.toString()); // Display the sorted query string // Output a=9&b=2&c=3&d=4
......@@ -273,7 +273,7 @@ keys(): IterableIterator&lt;string&gt;
**示例:**
```
```js
var searchParamsObject = new URLSearchParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing
for (var key of searchParamsObject .keys()) { // Output key-value pairs
console.log(key);
......@@ -295,7 +295,7 @@ values(): IterableIterator&lt;string&gt;
**示例:**
```
```js
var searchParams = new URLSearchParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing
for (var value of searchParams.values()) {
console.log(value);
......@@ -318,7 +318,7 @@ for (var value of searchParams.values()) {
**示例:**
```
```js
const paramsObject = new URLSearchParams('fod=bay&edg=bap');
for (const [name, value] of paramsObject) {
console.log(name, value);
......@@ -341,7 +341,7 @@ toString(): string
**示例:**
```
```js
let url = new URL('https://developer.exampleUrl/?fod=1&bard=2');
let params = new URLSearchParams(url.search.slice(1));
params.append('fod', 3);
......@@ -386,7 +386,7 @@ URL的构造函数。
**示例:**
```
```js
var mm = 'http://username:password@host:8080';
var a = new URL("/", mm); // Output 'http://username:password@host:8080/';
var b = new URL(mm); // Output 'http://username:password@host:8080/';
......@@ -416,7 +416,7 @@ toString(): string
**示例:**
```
```js
const url = new URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
url.toString()
```
......@@ -436,7 +436,7 @@ toJSON(): string
| string | 用于返回网址的字符串序列化。 |
**示例:**
```
```js
const url = new URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
url.toJSON()
```
......@@ -32,7 +32,7 @@ XmlSerializer的构造函数。
**示例:**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var bufView = new DataView(arrayBuffer);
var thatSer = new xml.XmlSerializer(bufView);
......@@ -54,7 +54,7 @@ setAttributes(name: string, value: string): void
**示例:**
```
```js
var thatSer = new xml.XmlSerializer(bufView);
thatSer.setAttributes("importance", "high");
```
......@@ -74,8 +74,8 @@ addEmptyElement(name: string): void
**示例:**
```
var thatSer = new xml.XmlSerializer(bufView);
```js
var thatSer = new xml.XmlSerializer(bufView);
thatSer.addEmptyElement("b"); // => <b/>
```
......@@ -88,7 +88,7 @@ setDeclaration(): void
**示例:**
```
```js
var thatSer = new xml.XmlSerializer(bufView);
thatSer.setDeclaration() // => <?xml version="1.0" encoding="utf-8"?>;
```
......@@ -108,7 +108,7 @@ startElement(name: string): void
**示例:**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("notel");
......@@ -124,7 +124,7 @@ endElement(): void
**示例:**
```
```js
var thatSer = new xml.XmlSerializer(bufView);
thatSer.setNamespace("h", "http://www.w3.org/TR/html4/");
thatSer.startElement("table");
......@@ -149,7 +149,7 @@ setNamespace(prefix: string, namespace: string): void
**示例:**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDeclaration();
......@@ -172,7 +172,7 @@ setComment(text: string): void
**示例:**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note");
......@@ -195,7 +195,7 @@ setCDATA(text: string): void
**示例:**
```
```js
var arrayBuffer = new ArrayBuffer(1028);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setCDATA('root SYSTEM') // => '<![CDATA[root SYSTEM]]>';
......@@ -216,7 +216,7 @@ setText(text: string): void
**示例:**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note");
......@@ -240,7 +240,7 @@ setDocType(text: string): void
**示例:**
```
```js
var arrayBuffer = new ArrayBuffer(1024);
var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDocType('root SYSTEM'); // => '<!DOCTYPE root SYSTEM>';
......@@ -265,7 +265,7 @@ constructor(buffer: ArrayBuffer | DataView, encoding?: string)
**示例:**
```
```js
var strXml =
'<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' +
......@@ -297,7 +297,7 @@ parse(option: ParseOptions): void
**示例:**
```
```js
var strXml =
'<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册