Mercurial > hg > nginx-site
annotate xml/ru/docs/njs/reference.xml @ 2505:ae52ac67048c
Linux packages: Added Alpine 3.11.
author | Konstantin Pavlov <thresh@nginx.com> |
---|---|
date | Tue, 25 Feb 2020 18:42:36 +0300 |
parents | 2aa02672d54f |
children | 6ce28e0beec0 |
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> |
2484
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
231 |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
232 <para> |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
233 Начиная с версии njs <link doc="changes.xml" id="njs0.3.8">0.3.8</link> |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
234 если не указан <literal>callback</literal>, |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
235 то возвращается объект <literal>Promise</literal>, |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
236 который разрешается в объект ответа подзапроса. |
2aa02672d54f
Added a note to r.subrequest in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2455
diff
changeset
|
237 </para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
238 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
239 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
240 </list> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
241 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
242 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
243 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
244 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
245 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
246 <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
|
247 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
248 <para> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
249 Объект stream-сессии доступен только в |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
250 модуле |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
251 <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
|
252 Все строки в объекте <literal>stream</literal> являются |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
253 <link id="string">байтовыми строками</link>. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
254 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
255 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
256 <para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
257 <list type="tag"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
258 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
259 <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
|
260 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
261 успешно финализирует обработчик фазы |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
262 (<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
|
263 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
264 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
265 <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
|
266 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
267 финализирует обработчик фазы и передаёт контроль следующему обработчику |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
268 (<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
|
269 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
270 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
271 <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
|
272 <tag-desc> |
2295
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 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
|
278 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
279 успешно финализирует текущий обработчик фазы |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
280 или финализирует его с указанным числовым кодом |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
281 (<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
|
282 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
283 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
284 <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
|
285 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
286 записывает отправленную <literal>строку</literal> в лог-файл ошибок |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
287 на уровне лога <literal>error</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
288 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
289 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
290 <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
|
291 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
292 записывает отправленную <value>строку</value> в лог-файл ошибок |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
293 на уровне лога <literal>info</literal> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
294 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
295 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
296 <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
|
297 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
298 отменяет регистрацию callback'а, установленного методом |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
299 <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
|
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 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
302 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
303 <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
|
304 <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
|
305 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
306 регистрирует <literal>callback</literal> для указанного <literal>события</literal> |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
307 (<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
|
308 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
309 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
310 <literal>Событием</literal> может являться одна из следующих строк: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
311 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
312 <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
|
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 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
316 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
317 <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
|
318 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
319 новые данные к клиенту |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
320 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
321 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
322 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
323 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
324 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
325 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
326 Callback завершения имеет следующий прототип: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
327 <literal>callback(данные, флаги)</literal>, где |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
328 <literal>данные</literal> являются строкой, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
329 <literal>флаги</literal> являются объектом |
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 type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
332 <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
|
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 true, если данные являются последним буфером. |
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 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
339 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
340 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
341 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
342 <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
|
343 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
344 адрес клиента, только чтение |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
345 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
346 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
347 <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
|
348 <value>параметры</value>])</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
349 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
350 отправляет данные клиенту |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
351 (<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
|
352 <literal>Параметры</literal> являются объектом, используемым |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
353 для переопределения флагов буфера nginx, |
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 Флаги могут быть переопределены при помощи следующих флагов: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
356 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
357 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
358 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
359 <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
|
360 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
361 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
362 true, если буфер является последним буфером |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
363 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
364 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
365 <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
|
366 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
367 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
368 true, если буфер должен иметь флаг <literal>flush</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
369 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
370 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
371 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
372 Метод может быть вызван несколько раз в течение одного вызова callback'a. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
373 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
374 |
2338
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
375 <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
|
376 <tag-desc> |
2338
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
377 объект переменных nginx, доступно для записи |
39ac205f90b7
Documented that r.variables{} and s.variables{} are writable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2337
diff
changeset
|
378 (начиная с версии <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
|
379 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
380 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
381 <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
|
382 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
383 записывает отправленную <literal>строку</literal> в лог-файл ошибок |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
384 на уровне лога <literal>warning</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
385 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
386 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
387 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
388 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
389 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
390 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
391 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
392 </section> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
393 |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
394 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
395 <section id="core" name="Core"> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
396 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
397 |
2405
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
398 <section id="core_global" name="Global"> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
399 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
400 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
401 <section id="process" name="Process"> |
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 Объект <literal>process</literal> является глобальным объектом, |
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 (<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
|
407 </para> |
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 <para> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
411 <list type="tag"> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
412 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
413 <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
|
414 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
415 Возвращает массив, содержащий аргументы командной строки, |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
416 передаваемые в момент запуска текущего процесса. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
417 </tag-desc> |
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 <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
|
420 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
421 Возвращает объект, содержащий переменные окружения пользователя. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
422 <note> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
423 По умолчанию nginx удаляет все переменные окружения, унаследованные |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
424 от своего родительского процесса, кроме переменной TZ. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
425 Для сохранения части унаследованных переменных |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
426 необходимо использовать директиву <link doc="../ngx_core_module.xml" id="env"/>. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
427 </note> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
428 </tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
429 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
430 <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
|
431 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
432 Возвращает PID текущего процесса. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
433 </tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
434 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
435 <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
|
436 <tag-desc> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
437 Возвращает PID текущего родительского процесса. |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
438 </tag-desc> |
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 </list> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
441 </para> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
442 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
443 </section> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
444 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
445 </section> |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
446 |
dbf68c949522
Documented the "process" global object.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2356
diff
changeset
|
447 |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
448 <section id="string" name="Строка"> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
449 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
450 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
451 В njs существует два типа строк: строка Unicode (по умолчанию) и |
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 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
456 Строка Unicode соответствует строке ECMAScript, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
457 содержащей символы Unicode. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
458 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
459 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
460 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
461 Байтовые строки содержат последовательность байт и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
462 используются для сериализации строк Unicode |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
463 во внешние данные и десериализации из внешних источников. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
464 Например метод <link id="string_toutf8">toUTF8()</link> сериализует |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
465 строку Unicode в байтовую строку используя кодировку UTF8: |
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 >> '£'.toUTF8().toString('hex') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
468 'c2a3' /* C2 A3 является UTF8-представлением 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 Метод <link id="string_tobytes">toBytes()</link> сериализует |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
471 строку Unicode с codepoints до 255 в байтовую строку, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
472 в противном случае возвращается <literal>null</literal>: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
473 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
474 >> '£'.toBytes().toString('hex') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
475 'a3' /* a3 является байтом, равным codepoint 00A3 ('£') */ |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
476 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
477 В различные кодировки могут быть преобразованы только байтовые строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
478 Например строка не может быть кодирована напрямую в <literal>hex</literal>: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
479 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
480 >> 'αβγδ'.toString('base64') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
481 TypeError: argument must be a byte string |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
482 at String.prototype.toString (native) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
483 at main (native) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
484 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
485 Чтобы преобразовать строку Unicode в hex, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
486 сначала необходимо её преобразовать в байтовую строку и затем в hex: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
487 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
488 >> 'αβγδ'.toUTF8().toString('base64') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
489 'zrHOss6zzrQ=' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
490 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
491 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
492 <list type="tag"> |
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 <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
|
495 | <value>строка</value>, <value>кодировка</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
496 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
497 (только в njs) Создаёт байтовую строку или из массива, содержащего октеты, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
498 или из кодированной строки |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
499 (<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
|
500 Кодировкой может быть |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
501 <literal>hex</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
502 <literal>base64</literal> и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
503 <literal>base64url</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
504 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
505 >> 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
|
506 'buffer' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
507 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
508 >> String.bytesFrom('YnVmZmVy', 'base64') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
509 'buffer' |
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 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
512 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
513 <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
|
514 <value>CharCodeN</value>]])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
515 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
516 Возвращает строку из одной или более Unicode codepoints. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
517 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
518 >> String.fromCharCode(97, 98, 99, 100) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
519 'abcd' |
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 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
522 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
523 <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
|
524 <value>codePoint2</value>]])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
525 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
526 Возвращает строку из одной или более Unicode codepoints. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
527 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
528 >> String.fromCodePoint(97, 98, 99, 100) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
529 'abcd' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
530 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
531 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
532 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
533 <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
|
534 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
535 Возвращает строку, представляющую одну кодовую единицу Unicode |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
536 внутри указанного <literal>индекса</literal>; |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
537 пустая строка, если индекс вне диапазона значений. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
538 Индекс может быть числом |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
539 между 0 и длиной строки минус 1. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
540 Если индекс не указан, то значение по умолчанию равно <literal>0</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
541 т.е. возвращается первый символ в строке. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
542 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
543 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
544 <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
|
545 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
546 Возвращает число, представляющее codepoint-значение символа |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
547 в пределах указанной <literal>позиции</literal>; |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
548 <literal>undefined</literal>, если элемент в позиции отсутствует. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
549 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
550 >> 'ABCD'.codePointAt(3); |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
551 68 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
552 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
553 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
554 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
555 <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
|
556 <value>строкаN</value>])</literal></tag-name> |
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 <literal>строк</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
560 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
561 >> "a".concat("b", "c") |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
562 'abc' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
563 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
564 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
565 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
566 <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
|
567 <value>длина</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
568 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
569 Возвращает <literal>true</literal>, если строка заканчивается символами |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
570 указанной строки, иначе <literal>false</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
571 Необязательный параметр <literal>длина</literal> задаёт длину строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
572 Если <value>ПоисковаяСтрока</value> не указана, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
573 значением по умолчанию является длина строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
574 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
575 >> 'abc'.endsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
576 true |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
577 >> 'abca'.endsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
578 false |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
579 </example> |
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_frombytes"><literal>String.prototype.fromBytes(<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) Возвращает новую строку Unicode из байтовой строки, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
586 в которой каждый байт заменяется соответствующей Unicode codepoint. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
587 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
588 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
589 <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
|
590 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
591 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
592 (только в njs) Преобразует байтовую строку, содержащую валидную строку UTF8, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
593 в строку Unicode, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
594 иначе возвращается <literal>null</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
595 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
596 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
597 <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
|
598 <value>позиция</value>]))</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
599 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
600 Возвращает <literal>true</literal>, если строка ищется внутри другой строки, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
601 иначе <literal>false</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
602 Необязательный параметр <literal>позиция</literal> задаёт позицию |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
603 внутри строки, от которой начинается поиск для <literal>поисковойСтроки</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
604 Значение по умолчанию равно 0. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
605 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
606 >> 'abc'.includes('bc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
607 true |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
608 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
609 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
610 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
611 <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
|
612 <value>fromIndex</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
613 <tag-desc> |
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 <literal>поисковойСтроки</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
616 Поиск начинается с <literal>fromIndex</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
617 Возвращает <value>-1</value>, если значение не найдено. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
618 <literal>fromIndex</literal> является числом, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
619 значение по умолчанию равно 0. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
620 Если <literal>fromIndex</literal> меньше, чем 0 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
621 или больше, чем |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
622 <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
|
623 поиск начнётся на индексе <value>0</value> и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
624 <value>String.prototype.length</value>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
625 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
626 >> 'abcdef'.indexOf('de', 2) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
627 3 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
628 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
629 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
630 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
631 <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
|
632 <value>fromIndex</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
633 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
634 Возвращает позицию последнего появления |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
635 of the <literal>поисковойСтроки</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
636 поиск осуществляется в обратном порядке от <literal>fromIndex</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
637 Возвращает <value>-1</value>, если значение не найдено. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
638 Если значение <literal>поисковойСтроки</literal> пустое, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
639 то возвращается <literal>fromIndex</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
640 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
641 >> "nginx".lastIndexOf("gi") |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
642 1 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
643 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
644 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
645 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
646 <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
|
647 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
648 Возвращает длину строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
649 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
650 >> 'αβγδ'.length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
651 4 |
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 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
654 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
655 <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
|
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 регулярным выражением. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
659 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
660 >> 'nginx'.match( /ng/i ) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
661 'ng' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
662 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
663 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
664 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
665 <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
|
666 [, <value>строка</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
667 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
668 Возвращает строку указанной длины, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
669 добавляя строку в конец указанной |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
670 строки (<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
|
671 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
672 >> '1234'.padEnd(8, 'abcd') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
673 '1234abcd' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
674 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
675 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
676 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
677 <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
|
678 [, <value>строка</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
679 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
680 Возвращает строку указанной длины, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
681 добавляя строку к началу указанной |
2337
867fe207f13e
Updated links to changes.xml in njs Reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
682 строки (<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
|
683 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
684 >> '1234'.padStart(8, 'abcd') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
685 'abcd1234' |
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 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
688 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
689 <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
|
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 с указанным числом копий строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
693 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
694 >> 'abc'.repeat(3) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
695 'abcabcabc' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
696 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
697 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
698 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
699 <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
|
700 <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
|
701 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
702 Возвращает новую строку, которая сопоставляется со |
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 и заменяется на <literal>строку</literal> или <literal>функцию</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
705 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
706 >> 'abcdefgh'.replace('d', 1) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
707 'abc1efgh' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
708 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
709 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
710 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
711 <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
|
712 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
713 Осуществляет поиск строки при помощи регулярного выражения. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
714 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
715 >> 'abcdefgh'.search('def') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
716 3 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
717 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
718 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
719 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
720 <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
|
721 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
722 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
723 Возвращает новую строку, содержащую часть |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
724 исходной строки между <literal>началом</literal> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
725 и <literal>концом</literal> или |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
726 от <literal>начала</literal> до конца строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
727 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
728 >> 'abcdefghijklmno'.slice(NaN, 5) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
729 'abcde' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
730 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
731 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
732 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
733 <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
|
734 <value>лимит</value>]]))</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
735 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
736 Возвращает совпадение строки регулярному выражению. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
737 Необязательный параметр <literal>лимит</literal> является числом, задающим |
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 >> 'abc'.split('') |
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 'a', |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
743 'b', |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
744 'c' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
745 ] |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
746 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
747 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
748 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
749 <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
|
750 <value>позиция</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
751 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
752 Возвращает <literal>true</literal>, если строка начинается с символов |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
753 указанной строки, иначе <literal>false</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
754 Необязательный параметр <literal>позиция</literal> является местом |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
755 в этой строке, с которого начинается поиск <literal>поисковойСтоки</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
756 Значение по умолчанию равно 0. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
757 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
758 >> 'abc'.startsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
759 true |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
760 > 'aabc'.startsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
761 false |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
762 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
763 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
764 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
765 <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
|
766 <value>длина</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
767 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
768 Возвращает часть строки указанной <literal>длины</literal> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
769 от <literal>начала</literal> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
770 или от <literal>начала</literal> до конца строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
771 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
772 >> 'abcdefghijklmno'.substr(3, 5) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
773 'defgh' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
774 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
775 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
776 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
777 <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
|
778 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
779 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
780 Возвращает часть строки между |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
781 <literal>началом</literal> и <literal>концом</literal> или |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
782 от от <literal>начала</literal> до конца строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
783 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
784 >> 'abcdefghijklmno'.substring(3, 5) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
785 'de' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
786 </example> |
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_tobytes"><literal>String.prototype.toBytes(начало[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
790 конец])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
791 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
792 (только в njs) Сериализует строку Unicode в байтовую строку. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
793 Возвращает <literal>null</literal>, если в строке найден символ больше, чем 255. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
794 </tag-desc> |
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 <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
|
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 Метод поддерживает только простое свёртывание Unicode. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
800 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
801 >> 'ΑΒΓΔ'.toLowerCase() |
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 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
804 </tag-desc> |
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 <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
|
807 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
808 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
809 Если кодировка не указана, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
810 возвращает указанную строку Unicode string или байтовую строку как в ECMAScript. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
811 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
812 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
813 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
814 (только в njs) Если кодировка указана, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
815 кодирует <link id="string_tobytes">байтовую строку</link> в |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
816 <literal>hex</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
817 <literal>base64</literal> или |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
818 <literal>base64url</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
819 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
820 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
821 >> 'αβγδ'.toUTF8().toString('base64url') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
822 'zrHOss6zzrQ' |
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 </tag-desc> |
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 <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
|
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 Метод поддерживает только простое свёртывание Unicode. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
830 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
831 >> 'αβγδ'.toUpperCase() |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
832 'ΑΒΓΔ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
833 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
834 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
835 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
836 <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
|
837 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
838 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
839 (только в njs) Сериализует строку Unicode |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
840 в байтовую строку при помощи кодирования UTF8. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
841 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
842 >> 'αβγδ'.toUTF8().length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
843 8 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
844 >> 'αβγδ'.length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
845 4 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
846 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
847 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
848 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
849 <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
|
850 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
851 Удаляет пробелы в начале и конце строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
852 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
853 >> ' abc '.trim() |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
854 'abc' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
855 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
856 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
857 |
2414 | 858 <tag-name id="string_trimend"><literal>String.prototype.trimEnd()</literal></tag-name> |
859 <tag-desc> | |
860 Удаляет пробелы в конце строки. | |
861 (<link doc="changes.xml" id="njs0.3.4">0.3.4</link>). | |
862 <example> | |
863 >> ' abc '.trimEnd() | |
864 ' abc' | |
865 </example> | |
866 </tag-desc> | |
867 | |
868 <tag-name id="string_trimstart"><literal>String.prototype.trimStart()</literal></tag-name> | |
869 <tag-desc> | |
870 Удаляет пробелы в начале строки. | |
871 (<link doc="changes.xml" id="njs0.3.4">0.3.4</link>). | |
872 <example> | |
873 >> ' abc '.trimStart() | |
874 'abc ' | |
875 </example> | |
876 </tag-desc> | |
877 | |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
878 <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
|
879 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
880 Кодирует URI путём замены определённых символов |
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 представляющие UTF-8 кодировку символа. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
883 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
884 >> encodeURI('012αβγδ') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
885 '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
|
886 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
887 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
888 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
889 <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
|
890 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
891 Кодирует URI путём замены определённых символов |
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 представляющие UTF-8 кодировку символа. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
894 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
895 >> encodeURIComponent('[@?=') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
896 '%5B%40%3F%3D' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
897 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
898 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
899 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
900 <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
|
901 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
902 Декодирует ранее <link id="encodeuri">кодированный</link> URI. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
903 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
904 >> 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
|
905 '012αβγδ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
906 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
907 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
908 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
909 <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
|
910 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
911 Декодирует ранее <link id="encodeuri">кодированный</link> URI. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
912 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
913 >> decodeURIComponent('%5B%40%3F%3D') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
914 '[@?=' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
915 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
916 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
917 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
918 </list> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
919 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
920 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
921 </section> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
922 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
923 </section> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
924 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
925 </article> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
926 |