Mercurial > hg > nginx-site
annotate xml/ru/docs/njs/reference.xml @ 2482:9bf87153b1b3
Added Release Notes for njs-0.3.8.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 21 Jan 2020 15:54:31 +0000 |
parents | a81518fa3802 |
children | 2aa02672d54f |
rev | line source |
---|---|
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
2 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
3 <!-- |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
4 Copyright (C) Nginx, Inc. |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
5 --> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
6 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
8 |
2246
32ba43abf9cd
Renamed njs API, njs Changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2244
diff
changeset
|
9 <article name="Справочник" |
32ba43abf9cd
Renamed njs API, njs Changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2244
diff
changeset
|
10 link="/ru/docs/njs/reference.html" |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
11 lang="ru" |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
12 rev="1"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
13 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
14 <section id="summary"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
15 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
16 <para> |
2244
467aef18bf12
Renamed the "About njs" page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2189
diff
changeset
|
17 <link doc="index.xml">njs</link> предоставляет объекты, методы и свойства |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
18 для расширения функциональности nginx. |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
19 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
20 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
21 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
22 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
23 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
24 <section id="http_stream" name="Объекты nginx"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
25 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
26 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
27 <section id="http" name="HTTP-запрос"> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
28 |
2189
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
29 <para> |
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
30 Объект <literal>HTTP</literal> доступен только в |
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
31 модуле <link doc="../http/ngx_http_js_module.xml">ngx_http_js_module</link>. |
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
32 Все строки в объекте <literal>HTTP</literal> являются |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
33 <link id="string">байтовыми строками</link>. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
34 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
35 <list type="tag"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
36 |
2353 | 37 <tag-name id="r_args"><literal>r.args{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
38 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
39 объект аргументов запроса, только чтение |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
40 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
41 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
42 <tag-name><literal>r.error(<value>строка</value>)</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
43 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
44 записывает <literal>строку</literal> в лог-файл ошибок |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
45 на уровне лога <literal>error</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
46 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
47 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
48 <tag-name><literal>r.finish()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
49 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
50 завершает отправку ответа клиенту |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
51 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
52 |
2353 | 53 <tag-name id="r_headers_in"><literal>r.headersIn{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
54 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
55 объект входящих заголовков, только чтение. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
56 <para> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
57 Например, доступ к заголовку <literal>Foo</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
58 можно получить при помощи синтаксиса <literal>headersIn.foo</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
59 или <literal>headersIn['Foo']</literal> |
2441
080581ce888d
Added note to r.headersIn in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2414
diff
changeset
|
60 <note> |
2446 | 61 До версии <link doc="changes.xml" id="njs0.3.6">0.3.6</link> |
62 если заголовок был указан несколько раз, например | |
2441
080581ce888d
Added note to r.headersIn in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2414
diff
changeset
|
63 <header>Cookie</header> или <header>X-Forwarded-For</header>, |
2446 | 64 то возвращалось только первое значение. |
2441
080581ce888d
Added note to r.headersIn in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2414
diff
changeset
|
65 Чтобы получить все cookie |
080581ce888d
Added note to r.headersIn in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2414
diff
changeset
|
66 необходимо использовать |
080581ce888d
Added note to r.headersIn in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2414
diff
changeset
|
67 <literal>r.variables.http_cookie</literal>. |
080581ce888d
Added note to r.headersIn in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2414
diff
changeset
|
68 Чтобы получить <literal>имя</literal> cookie |
080581ce888d
Added note to r.headersIn in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2414
diff
changeset
|
69 необходимо использовать |
080581ce888d
Added note to r.headersIn in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2414
diff
changeset
|
70 <literal>r.variables["cookie_<value>имя</value>"]</literal>. |
080581ce888d
Added note to r.headersIn in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2414
diff
changeset
|
71 </note> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
72 </para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
73 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
74 |
2353 | 75 <tag-name id="r_headers_out"><literal>r.headersOut{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
76 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
77 объект исходящих заголовков, доступно для записи. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
78 <para> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
79 Например, доступ к заголовку <literal>Foo</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
80 можно получить при помощи синтаксиса <literal>headersOut.foo</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
81 или <literal>headersOut['Foo']</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
82 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
83 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
84 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
85 <tag-name><literal>r.httpVersion</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
86 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
87 версия HTTP, только чтение |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
88 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
89 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
90 <tag-name><literal>r.log(<value>строка</value>)</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
91 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
92 записывает <literal>строку</literal> в лог-файл ошибок |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
93 на уровне лога <literal>info</literal> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
94 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
95 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
96 <tag-name id="r_internal_redirect"><literal>r.internalRedirect(<value>uri</value>)</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
97 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
98 осуществляет внутреннее перенаправление на указанный <literal>uri</literal>. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
99 Если uri начинается с префикса “<literal>@</literal>”, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
100 то он считается именованным location. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
101 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
102 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
103 <tag-name><literal>r.method</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
104 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
105 HTTP метод, только чтение |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
106 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
107 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
108 <tag-name><literal>r.parent</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
109 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
110 ссылается на родительский объект запроса |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
111 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
112 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
113 <tag-name><literal>r.remoteAddress</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
114 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
115 адрес клиента, только чтение |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
116 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
117 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
118 <tag-name id="r_request_body"><literal>r.requestBody</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
119 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
120 возвращает тело запроса клиента, если оно не было |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
121 записано во временный файл. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
122 Чтобы убедиться, что тело запроса клиента находится в памяти, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
123 его размер должен быть ограничен |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
124 <link doc="../http/ngx_http_core_module.xml" id="client_max_body_size"/>, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
125 и также необходимо установить достаточный размер буфера при помощи |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
126 <link doc="../http/ngx_http_core_module.xml" id="client_body_buffer_size"/>. |
2356
ea6964391d52
Clarified usage of r.requestBody in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2353
diff
changeset
|
127 Свойство доступно только в директиве |
ea6964391d52
Clarified usage of r.requestBody in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2353
diff
changeset
|
128 <link doc="../http/ngx_http_js_module.xml" id="js_content"/>. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
129 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
130 |
2353 | 131 <tag-name id="r_response_body"><literal>r.responseBody</literal></tag-name> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
132 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
133 хранит тело ответа <link id="subrequest">подзапроса</link>, только чтение. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
134 Размер <literal>r.responseBody</literal> ограничивается директивой |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
135 <link doc="../http/ngx_http_core_module.xml" id="subrequest_output_buffer_size"/>. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
136 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
137 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
138 <tag-name><literal>r.return(код[, строка])</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
139 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
140 отправляет |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
141 клиенту полный ответ с указанным <literal>кодом</literal> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
142 <para> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
143 Можно задать или URL перенаправления |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
144 (для кодов 301, 302, 303, 307 и 308), |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
145 или текст тела ответа (для остальных кодов) в качестве второго аргумента |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
146 </para> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
147 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
148 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
149 <tag-name><literal>r.send(<value>строка</value>)</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
150 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
151 отправляет часть тела ответа клиенту |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
152 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
153 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
154 <tag-name><literal>r.sendHeader()</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
155 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
156 отправляет заголовки HTTP клиенту |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
157 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
158 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
159 <tag-name><literal>r.status</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
160 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
161 статус, доступно для записи |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
162 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
163 |
2338
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
164 <tag-name id="r_variables"><literal>r.variables{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
165 <tag-desc> |
2338
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
166 объект переменных nginx, доступно для записи |
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
167 (начиная с версии <link doc="changes.xml" id="njs0.2.8">0.2.8</link>) |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
168 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
169 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
170 <tag-name><literal>r.warn(<value>строка</value>)</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
171 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
172 записывает <literal>строку</literal> в лог-файл ошибок |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
173 на уровне лога <literal>warning</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
174 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
175 |
2348
5e17930672f5
Clarified description of r.uri in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2344
diff
changeset
|
176 <tag-name id="r_uri"><literal>r.uri</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
177 <tag-desc> |
2348
5e17930672f5
Clarified description of r.uri in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2344
diff
changeset
|
178 текущий <link doc="../http/ngx_http_core_module.xml" id="var_uri">URI</link> |
5e17930672f5
Clarified description of r.uri in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2344
diff
changeset
|
179 запроса в |
5e17930672f5
Clarified description of r.uri in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2344
diff
changeset
|
180 <link doc="../http/ngx_http_core_module.xml" id="location">нормализованном</link> |
5e17930672f5
Clarified description of r.uri in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2344
diff
changeset
|
181 виде, только чтение |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
182 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
183 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
184 <tag-name id="subrequest"><literal>r.subrequest(<value>uri</value>[, |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
185 <value>options</value>[, <value>callback</value>]])</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
186 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
187 создаёт подзапрос с заданными <literal>uri</literal> и |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
188 <literal>options</literal> и устанавливает |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
189 необязательный <literal>callback</literal> завершения. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
190 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
191 <para> |
2340
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
192 <link doc="../dev/development_guide.xml.xml" id="http_subrequests">Подзапрос</link> |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
193 использует входящиe заголовки клиентского запроса. |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
194 Для отправки на проксируемый сервер заголовков, отличных от оригинальных, |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
195 может использоваться директива |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
196 <link doc="../http/ngx_http_proxy_module.xml" id="proxy_set_header"/>. |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
197 Для отправки на проксируемый сервер нового набора заголовков |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
198 может использоваться директива |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
199 <link doc="../http/ngx_http_proxy_module.xml" id="proxy_pass_request_headers"/>. |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
200 </para> |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
201 |
537130c40c1f
Updated r.subrequest desctiption in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2338
diff
changeset
|
202 <para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
203 Если <literal>options</literal> является строкой, то в ней |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
204 содержится срока аргументов подзапроса. |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
205 В противном случае ожидается, что <literal>options</literal> является |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
206 объектом со следующими ключами: |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
207 <list type="tag"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
208 <tag-name><literal>args</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
209 <tag-desc> |
2344
ea8ccaac18b4
Added default values for r.subrequest options in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2340
diff
changeset
|
210 строка с аргументами, по умолчанию используется пустая строка |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
211 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
212 <tag-name><literal>body</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
213 <tag-desc> |
2344
ea8ccaac18b4
Added default values for r.subrequest options in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2340
diff
changeset
|
214 тело запроса, |
ea8ccaac18b4
Added default values for r.subrequest options in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2340
diff
changeset
|
215 по умолчанию используется тело запроса родительского объекта запроса |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
216 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
217 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
218 <tag-name><literal>method</literal></tag-name> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
219 <tag-desc> |
2344
ea8ccaac18b4
Added default values for r.subrequest options in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2340
diff
changeset
|
220 метод HTTP, по умолчанию используется метод <literal>GET</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
221 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
222 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
223 </list> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
224 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
225 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
226 <para> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
227 <literal>callback</literal> получает |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
228 объект ответа подзапроса с методами и свойствами, |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
229 идентичными родительскому объекту запроса. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
230 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
231 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
232 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
233 </list> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
234 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
235 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
236 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
237 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
238 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
239 <section id="stream" name="Stream-сессия"> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
240 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
241 <para> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
242 Объект stream-сессии доступен только в |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
243 модуле |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
244 <link doc="../stream/ngx_stream_js_module.xml">ngx_stream_js_module</link>. |
2189
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
245 Все строки в объекте <literal>stream</literal> являются |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
246 <link id="string">байтовыми строками</link>. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
247 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
248 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
249 <para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
250 <list type="tag"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
251 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
252 <tag-name id="s_allow"><literal>s.allow()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
253 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
254 успешно финализирует обработчик фазы |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
255 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>) |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
256 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
257 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
258 <tag-name id="s_decline"><literal>s.decline()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
259 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
260 финализирует обработчик фазы и передаёт контроль следующему обработчику |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
261 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>) |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
262 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
263 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
264 <tag-name id="s_deny"><literal>s.deny()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
265 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
266 финализирует обработчик фазы с кодом ошибки доступа |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
267 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>) |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
268 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
269 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
270 <tag-name id="s_done"><literal>s.done</literal>(<value>[код]</value>)</tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
271 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
272 успешно финализирует текущий обработчик фазы |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
273 или финализирует его с указанным числовым кодом |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
274 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>). |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
275 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
276 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
277 <tag-name><literal>s.error(<value>строка</value>)</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
278 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
279 записывает отправленную <literal>строку</literal> в лог-файл ошибок |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
280 на уровне лога <literal>error</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
281 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
282 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
283 <tag-name><literal>s.log(<value>строка</value>)</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
284 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
285 записывает отправленную <value>строку</value> в лог-файл ошибок |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
286 на уровне лога <literal>info</literal> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
287 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
288 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
289 <tag-name id="s_off"><literal>s.off(<value>имяСобытия</value>)</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
290 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
291 отменяет регистрацию callback'а, установленного методом |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
292 <link id="s_on">s.on()</link> |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
293 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>) |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
294 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
295 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
296 <tag-name id="s_on"><literal>s.on(<value>событие</value>, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
297 <value>callback</value>)</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
298 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
299 регистрирует <literal>callback</literal> для указанного <literal>события</literal> |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
300 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>). |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
301 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
302 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
303 <literal>Событием</literal> может являться одна из следующих строк: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
304 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
305 <tag-name><literal>upload</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
306 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
307 новые данные от клиента |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
308 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
309 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
310 <tag-name><literal>download</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
311 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
312 новые данные к клиенту |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
313 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
314 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
315 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
316 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
317 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
318 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
319 Callback завершения имеет следующий прототип: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
320 <literal>callback(данные, флаги)</literal>, где |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
321 <literal>данные</literal> являются строкой, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
322 <literal>флаги</literal> являются объектом |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
323 со следующими свойствами: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
324 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
325 <tag-name id="s_on_callback_last"><literal>last</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
326 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
327 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
328 true, если данные являются последним буфером. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
329 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
330 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
331 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
332 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
333 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
334 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
335 <tag-name><literal>s.remoteAddress</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
336 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
337 адрес клиента, только чтение |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
338 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
339 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
340 <tag-name id="s_send"><literal>s.send(<value>данные</value>[, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
341 <value>параметры</value>])</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
342 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
343 отправляет данные клиенту |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
344 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>). |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
345 <literal>Параметры</literal> являются объектом, используемым |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
346 для переопределения флагов буфера nginx, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
347 полученных из буфера входных данных. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
348 Флаги могут быть переопределены при помощи следующих флагов: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
349 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
350 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
351 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
352 <tag-name><literal>last</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
353 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
354 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
355 true, если буфер является последним буфером |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
356 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
357 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
358 <tag-name><literal>flush</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
359 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
360 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
361 true, если буфер должен иметь флаг <literal>flush</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
362 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
363 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
364 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
365 Метод может быть вызван несколько раз в течение одного вызова callback'a. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
366 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
367 |
2338
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
368 <tag-name id="s_variables"><literal>s.variables{}</literal></tag-name> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
369 <tag-desc> |
2338
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
370 объект переменных nginx, доступно для записи |
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
371 (начиная с версии <link doc="changes.xml" id="njs0.2.8">0.2.8</link>) |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
372 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
373 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
374 <tag-name><literal>s.warn(<value>строка</value>)</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
375 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
376 записывает отправленную <literal>строку</literal> в лог-файл ошибок |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
377 на уровне лога <literal>warning</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
378 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
379 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
380 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
381 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
382 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
383 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
384 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
385 </section> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
386 |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
387 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
388 <section id="core" name="Core"> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
389 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
390 |
2405
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
391 <section id="core_global" name="Global"> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
392 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
393 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
394 <section id="process" name="Process"> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
395 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
396 <para> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
397 Объект <literal>process</literal> является глобальным объектом, |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
398 предоставляющим информацию о текущем процессе |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
399 (<link doc="changes.xml" id="njs0.3.3">0.3.3</link>). |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
400 </para> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
401 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
402 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
403 <para> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
404 <list type="tag"> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
405 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
406 <tag-name id="process_argv"><literal>process.argv</literal></tag-name> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
407 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
408 Возвращает массив, содержащий аргументы командной строки, |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
409 передаваемые в момент запуска текущего процесса. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
410 </tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
411 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
412 <tag-name id="process_env"><literal>process.env</literal></tag-name> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
413 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
414 Возвращает объект, содержащий переменные окружения пользователя. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
415 <note> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
416 По умолчанию nginx удаляет все переменные окружения, унаследованные |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
417 от своего родительского процесса, кроме переменной TZ. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
418 Для сохранения части унаследованных переменных |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
419 необходимо использовать директиву <link doc="../ngx_core_module.xml" id="env"/>. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
420 </note> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
421 </tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
422 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
423 <tag-name id="process_pid"><literal>process.pid</literal></tag-name> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
424 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
425 Возвращает PID текущего процесса. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
426 </tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
427 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
428 <tag-name id="process_ppid"><literal>process.ppid</literal></tag-name> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
429 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
430 Возвращает PID текущего родительского процесса. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
431 </tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
432 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
433 </list> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
434 </para> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
435 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
436 </section> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
437 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
438 </section> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
439 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
440 |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
441 <section id="string" name="Строка"> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
442 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
443 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
444 В njs существует два типа строк: строка Unicode (по умолчанию) и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
445 байтовая строка. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
446 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
447 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
448 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
449 Строка Unicode соответствует строке ECMAScript, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
450 содержащей символы Unicode. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
451 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
452 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
453 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
454 Байтовые строки содержат последовательность байт и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
455 используются для сериализации строк Unicode |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
456 во внешние данные и десериализации из внешних источников. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
457 Например метод <link id="string_toutf8">toUTF8()</link> сериализует |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
458 строку Unicode в байтовую строку используя кодировку UTF8: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
459 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
460 >> '£'.toUTF8().toString('hex') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
461 'c2a3' /* C2 A3 является UTF8-представлением codepoint 00A3 ('£') */ |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
462 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
463 Метод <link id="string_tobytes">toBytes()</link> сериализует |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
464 строку Unicode с codepoints до 255 в байтовую строку, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
465 в противном случае возвращается <literal>null</literal>: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
466 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
467 >> '£'.toBytes().toString('hex') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
468 'a3' /* a3 является байтом, равным codepoint 00A3 ('£') */ |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
469 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
470 В различные кодировки могут быть преобразованы только байтовые строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
471 Например строка не может быть кодирована напрямую в <literal>hex</literal>: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
472 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
473 >> 'αβγδ'.toString('base64') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
474 TypeError: argument must be a byte string |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
475 at String.prototype.toString (native) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
476 at main (native) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
477 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
478 Чтобы преобразовать строку Unicode в hex, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
479 сначала необходимо её преобразовать в байтовую строку и затем в hex: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
480 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
481 >> 'αβγδ'.toUTF8().toString('base64') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
482 'zrHOss6zzrQ=' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
483 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
484 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
485 <list type="tag"> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
486 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
487 <tag-name id="string_bytesfrom"><literal>String.bytesFrom(<value>массив</value> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
488 | <value>строка</value>, <value>кодировка</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
489 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
490 (только в njs) Создаёт байтовую строку или из массива, содержащего октеты, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
491 или из кодированной строки |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
492 (<link doc="changes.xml" id="njs0.2.3">0.2.3</link>). |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
493 Кодировкой может быть |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
494 <literal>hex</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
495 <literal>base64</literal> и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
496 <literal>base64url</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
497 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
498 >> String.bytesFrom([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
499 'buffer' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
500 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
501 >> String.bytesFrom('YnVmZmVy', 'base64') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
502 'buffer' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
503 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
504 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
505 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
506 <tag-name id="string_fromcharcode"><literal>String.fromCharCode(<value>CharCode1</value>[, ...[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
507 <value>CharCodeN</value>]])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
508 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
509 Возвращает строку из одной или более Unicode codepoints. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
510 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
511 >> String.fromCharCode(97, 98, 99, 100) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
512 'abcd' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
513 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
514 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
515 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
516 <tag-name id="string_fromcodepoint"><literal>String.fromCodePoint(<value>codePoint1</value>[, ...[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
517 <value>codePoint2</value>]])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
518 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
519 Возвращает строку из одной или более Unicode codepoints. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
520 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
521 >> String.fromCodePoint(97, 98, 99, 100) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
522 'abcd' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
523 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
524 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
525 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
526 <tag-name id="string_charat"><literal>String.prototype.charAt(<value>индекс</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
527 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
528 Возвращает строку, представляющую одну кодовую единицу Unicode |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
529 внутри указанного <literal>индекса</literal>; |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
530 пустая строка, если индекс вне диапазона значений. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
531 Индекс может быть числом |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
532 между 0 и длиной строки минус 1. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
533 Если индекс не указан, то значение по умолчанию равно <literal>0</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
534 т.е. возвращается первый символ в строке. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
535 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
536 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
537 <tag-name id="string_codepointat"><literal>String.prototype.CodePointAt(<value>позиция</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
538 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
539 Возвращает число, представляющее codepoint-значение символа |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
540 в пределах указанной <literal>позиции</literal>; |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
541 <literal>undefined</literal>, если элемент в позиции отсутствует. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
542 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
543 >> 'ABCD'.codePointAt(3); |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
544 68 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
545 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
546 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
547 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
548 <tag-name id="string_concat"><literal>String.prototype.concat(<value>строка1</value>[, ..., |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
549 <value>строкаN</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
550 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
551 Возвращает строку, содержающую результат объединения указанных |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
552 <literal>строк</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
553 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
554 >> "a".concat("b", "c") |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
555 'abc' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
556 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
557 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
558 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
559 <tag-name id="string_endswith"><literal>String.prototype.endsWith(<value>ПоисковаяСтрока</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
560 <value>длина</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
561 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
562 Возвращает <literal>true</literal>, если строка заканчивается символами |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
563 указанной строки, иначе <literal>false</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
564 Необязательный параметр <literal>длина</literal> задаёт длину строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
565 Если <value>ПоисковаяСтрока</value> не указана, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
566 значением по умолчанию является длина строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
567 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
568 >> 'abc'.endsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
569 true |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
570 >> 'abca'.endsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
571 false |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
572 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
573 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
574 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
575 <tag-name id="string_frombytes"><literal>String.prototype.fromBytes(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
576 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
577 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
578 (только в njs) Возвращает новую строку Unicode из байтовой строки, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
579 в которой каждый байт заменяется соответствующей Unicode codepoint. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
580 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
581 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
582 <tag-name id="string_fromutf8"><literal>String.prototype.fromUTF8(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
583 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
584 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
585 (только в njs) Преобразует байтовую строку, содержащую валидную строку UTF8, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
586 в строку Unicode, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
587 иначе возвращается <literal>null</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
588 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
589 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
590 <tag-name id="string_includes"><literal>String.prototype.includes(<value>поисковаяСтрока</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
591 <value>позиция</value>]))</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
592 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
593 Возвращает <literal>true</literal>, если строка ищется внутри другой строки, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
594 иначе <literal>false</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
595 Необязательный параметр <literal>позиция</literal> задаёт позицию |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
596 внутри строки, от которой начинается поиск для <literal>поисковойСтроки</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
597 Значение по умолчанию равно 0. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
598 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
599 >> 'abc'.includes('bc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
600 true |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
601 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
602 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
603 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
604 <tag-name id="string_indexof"><literal>String.prototype.indexOf(<value>поисковаяСтрока</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
605 <value>fromIndex</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
606 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
607 Возвращает позицию первого появления |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
608 <literal>поисковойСтроки</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
609 Поиск начинается с <literal>fromIndex</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
610 Возвращает <value>-1</value>, если значение не найдено. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
611 <literal>fromIndex</literal> является числом, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
612 значение по умолчанию равно 0. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
613 Если <literal>fromIndex</literal> меньше, чем 0 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
614 или больше, чем |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
615 <link id="string_length">String.prototype.length</link><value></value>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
616 поиск начнётся на индексе <value>0</value> и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
617 <value>String.prototype.length</value>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
618 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
619 >> 'abcdef'.indexOf('de', 2) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
620 3 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
621 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
622 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
623 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
624 <tag-name id="string_lastindexof"><literal>String.prototype.lastIndexOf(<value>поисковаяСтрока</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
625 <value>fromIndex</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
626 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
627 Возвращает позицию последнего появления |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
628 of the <literal>поисковойСтроки</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
629 поиск осуществляется в обратном порядке от <literal>fromIndex</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
630 Возвращает <value>-1</value>, если значение не найдено. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
631 Если значение <literal>поисковойСтроки</literal> пустое, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
632 то возвращается <literal>fromIndex</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
633 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
634 >> "nginx".lastIndexOf("gi") |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
635 1 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
636 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
637 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
638 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
639 <tag-name id="string_length"><literal>String.prototype.length</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
640 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
641 Возвращает длину строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
642 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
643 >> 'αβγδ'.length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
644 4 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
645 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
646 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
647 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
648 <tag-name id="string_match"><literal>String.prototype.match([<value>регулярноеВыражение</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
649 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
650 Возвращает совпадение при сопоставлении строки с |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
651 регулярным выражением. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
652 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
653 >> 'nginx'.match( /ng/i ) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
654 'ng' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
655 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
656 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
657 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
658 <tag-name id="string_padend"><literal>String.prototype.padEnd(<value>длина</value> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
659 [, <value>строка</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
660 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
661 Возвращает строку указанной длины, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
662 добавляя строку в конец указанной |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
663 строки (<link doc="changes.xml" id="njs0.2.3">0.2.3</link>). |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
664 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
665 >> '1234'.padEnd(8, 'abcd') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
666 '1234abcd' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
667 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
668 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
669 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
670 <tag-name id="string_padstart"><literal>String.prototype.padStart(<value>длина</value> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
671 [, <value>строка</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
672 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
673 Возвращает строку указанной длины, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
674 добавляя строку к началу указанной |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
675 строки (<link doc="changes.xml" id="njs0.2.3">0.2.3</link>). |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
676 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
677 >> '1234'.padStart(8, 'abcd') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
678 'abcd1234' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
679 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
680 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
681 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
682 <tag-name id="string_repeat"><literal>String.prototype.repeat(<value>число</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
683 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
684 Возвращает строку |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
685 с указанным числом копий строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
686 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
687 >> 'abc'.repeat(3) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
688 'abcabcabc' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
689 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
690 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
691 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
692 <tag-name id="string_replace"><literal>String.prototype.replace([<value>регулярноеВыражение</value>|<value>string</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
693 <value>string</value>|<value>function</value>]])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
694 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
695 Возвращает новую строку, которая сопоставляется со |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
696 строкой или регулярным выражением, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
697 и заменяется на <literal>строку</literal> или <literal>функцию</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
698 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
699 >> 'abcdefgh'.replace('d', 1) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
700 'abc1efgh' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
701 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
702 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
703 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
704 <tag-name id="string_search"><literal>String.prototype.search([<value>регулярноеВыражение</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
705 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
706 Осуществляет поиск строки при помощи регулярного выражения. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
707 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
708 >> 'abcdefgh'.search('def') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
709 3 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
710 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
711 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
712 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
713 <tag-name id="string_slice"><literal>String.prototype.slice(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
714 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
715 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
716 Возвращает новую строку, содержащую часть |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
717 исходной строки между <literal>началом</literal> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
718 и <literal>концом</literal> или |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
719 от <literal>начала</literal> до конца строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
720 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
721 >> 'abcdefghijklmno'.slice(NaN, 5) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
722 'abcde' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
723 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
724 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
725 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
726 <tag-name id="string_split"><literal>String.prototype.split(([<value>строка</value>|<value>регулярноеВыражение</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
727 <value>лимит</value>]]))</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
728 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
729 Возвращает совпадение строки регулярному выражению. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
730 Необязательный параметр <literal>лимит</literal> является числом, задающим |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
731 ограничение на количество найденных подстрок. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
732 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
733 >> 'abc'.split('') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
734 [ |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
735 'a', |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
736 'b', |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
737 'c' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
738 ] |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
739 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
740 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
741 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
742 <tag-name id="string_startswith"><literal>String.prototype.startsWith(<value>поисковаяСтрока</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
743 <value>позиция</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
744 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
745 Возвращает <literal>true</literal>, если строка начинается с символов |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
746 указанной строки, иначе <literal>false</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
747 Необязательный параметр <literal>позиция</literal> является местом |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
748 в этой строке, с которого начинается поиск <literal>поисковойСтоки</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
749 Значение по умолчанию равно 0. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
750 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
751 >> 'abc'.startsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
752 true |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
753 > 'aabc'.startsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
754 false |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
755 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
756 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
757 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
758 <tag-name id="string_substr"><literal>String.prototype.substr(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
759 <value>длина</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
760 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
761 Возвращает часть строки указанной <literal>длины</literal> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
762 от <literal>начала</literal> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
763 или от <literal>начала</literal> до конца строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
764 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
765 >> 'abcdefghijklmno'.substr(3, 5) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
766 'defgh' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
767 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
768 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
769 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
770 <tag-name id="string_substring"><literal>String.prototype.substring(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
771 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
772 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
773 Возвращает часть строки между |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
774 <literal>началом</literal> и <literal>концом</literal> или |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
775 от от <literal>начала</literal> до конца строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
776 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
777 >> 'abcdefghijklmno'.substring(3, 5) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
778 'de' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
779 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
780 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
781 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
782 <tag-name id="string_tobytes"><literal>String.prototype.toBytes(начало[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
783 конец])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
784 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
785 (только в njs) Сериализует строку Unicode в байтовую строку. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
786 Возвращает <literal>null</literal>, если в строке найден символ больше, чем 255. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
787 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
788 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
789 <tag-name id="string_tolowercase"><literal>String.prototype.toLowerCase()</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
790 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
791 Преобразует строку в нижний регистр. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
792 Метод поддерживает только простое свёртывание Unicode. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
793 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
794 >> 'ΑΒΓΔ'.toLowerCase() |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
795 'αβγδ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
796 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
797 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
798 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
799 <tag-name><literal>String.prototype.toString([<value>кодировка</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
800 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
801 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
802 Если кодировка не указана, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
803 возвращает указанную строку Unicode string или байтовую строку как в ECMAScript. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
804 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
805 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
806 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
807 (только в njs) Если кодировка указана, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
808 кодирует <link id="string_tobytes">байтовую строку</link> в |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
809 <literal>hex</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
810 <literal>base64</literal> или |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
811 <literal>base64url</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
812 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
813 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
814 >> 'αβγδ'.toUTF8().toString('base64url') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
815 'zrHOss6zzrQ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
816 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
817 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
818 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
819 <tag-name id="string_touppercase"><literal>String.prototype.toUpperCase()</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
820 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
821 Преобразует строку в верхний регистр. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
822 Метод поддерживает только простое свёртывание Unicode. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
823 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
824 >> 'αβγδ'.toUpperCase() |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
825 'ΑΒΓΔ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
826 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
827 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
828 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
829 <tag-name id="string_toutf8"><literal>String.prototype.toUTF8(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
830 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
831 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
832 (только в njs) Сериализует строку Unicode |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
833 в байтовую строку при помощи кодирования UTF8. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
834 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
835 >> 'αβγδ'.toUTF8().length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
836 8 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
837 >> 'αβγδ'.length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
838 4 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
839 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
840 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
841 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
842 <tag-name id="string_trim"><literal>String.prototype.trim()</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
843 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
844 Удаляет пробелы в начале и конце строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
845 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
846 >> ' abc '.trim() |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
847 'abc' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
848 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
849 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
850 |
2414 | 851 <tag-name id="string_trimend"><literal>String.prototype.trimEnd()</literal></tag-name> |
852 <tag-desc> | |
853 Удаляет пробелы в конце строки. | |
854 (<link doc="changes.xml" id="njs0.3.4">0.3.4</link>). | |
855 <example> | |
856 >> ' abc '.trimEnd() | |
857 ' abc' | |
858 </example> | |
859 </tag-desc> | |
860 | |
861 <tag-name id="string_trimstart"><literal>String.prototype.trimStart()</literal></tag-name> | |
862 <tag-desc> | |
863 Удаляет пробелы в начале строки. | |
864 (<link doc="changes.xml" id="njs0.3.4">0.3.4</link>). | |
865 <example> | |
866 >> ' abc '.trimStart() | |
867 'abc ' | |
868 </example> | |
869 </tag-desc> | |
870 | |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
871 <tag-name id="encodeuri"><literal>encodeURI(<value>URI</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
872 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
873 Кодирует URI путём замены определённых символов |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
874 на одну, две, три или четыре последовательности, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
875 представляющие UTF-8 кодировку символа. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
876 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
877 >> encodeURI('012αβγδ') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
878 '012%CE%B1%CE%B2%CE%B3%CE%B4' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
879 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
880 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
881 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
882 <tag-name id="encodeuricomponent"><literal>encodeURIComponent(<value>encodedURIString</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
883 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
884 Кодирует URI путём замены определённых символов |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
885 на одну, две, три или четыре последовательности, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
886 представляющие UTF-8 кодировку символа. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
887 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
888 >> encodeURIComponent('[@?=') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
889 '%5B%40%3F%3D' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
890 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
891 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
892 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
893 <tag-name id="decodeuri"><literal>decodeURI(<value>encodedURI</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
894 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
895 Декодирует ранее <link id="encodeuri">кодированный</link> URI. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
896 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
897 >> decodeURI('012%CE%B1%CE%B2%CE%B3%CE%B4') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
898 '012αβγδ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
899 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
900 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
901 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
902 <tag-name id="decodeuricomponent"><literal>decodeURIComponent(<value>decodedURIString</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
903 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
904 Декодирует ранее <link id="encodeuri">кодированный</link> URI. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
905 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
906 >> decodeURIComponent('%5B%40%3F%3D') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
907 '[@?=' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
908 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
909 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
910 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
911 </list> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
912 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
913 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
914 </section> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
915 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
916 </section> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
917 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
918 </article> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
919 |