Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_js_module.xml @ 2901:9719a0184a67
Documented the js_preload_object directive.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Fri, 21 Oct 2022 12:19:07 +0100 |
parents | 986e1f930e3b |
children | 7e83ebfac8ca |
comparison
equal
deleted
inserted
replaced
2900:e4a87f3a05d8 | 2901:9719a0184a67 |
---|---|
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> | 7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
8 | 8 |
9 <module name="Module ngx_http_js_module" | 9 <module name="Module ngx_http_js_module" |
10 link="/en/docs/http/ngx_http_js_module.html" | 10 link="/en/docs/http/ngx_http_js_module.html" |
11 lang="en" | 11 lang="en" |
12 rev="36"> | 12 rev="37"> |
13 | 13 |
14 <section id="summary"> | 14 <section id="summary"> |
15 | 15 |
16 <para> | 16 <para> |
17 The <literal>ngx_http_js_module</literal> module is used to implement | 17 The <literal>ngx_http_js_module</literal> module is used to implement |
537 </para> | 537 </para> |
538 | 538 |
539 </directive> | 539 </directive> |
540 | 540 |
541 | 541 |
542 <directive name="js_preload_object"> | |
543 <syntax><value>name.json</value> | | |
544 <value>name</value> from <value>file.json</value></syntax> | |
545 <default/> | |
546 <context>http</context> | |
547 <context>server</context> | |
548 <context>location</context> | |
549 <appeared-in>0.7.8</appeared-in> | |
550 | |
551 <para> | |
552 Preloads an immutable object at configure time. | |
553 The <literal>name</literal> is used a name of the global variable | |
554 though which the object is available in njs code. | |
555 If the <literal>name</literal> is not specified, | |
556 the file name will be used instead. | |
557 <example> | |
558 js_preload_object map.json; | |
559 </example> | |
560 Here, the <literal>map</literal> is used as a name | |
561 while accessing the preloaded object. | |
562 </para> | |
563 | |
564 <para> | |
565 Several <literal>js_preload_object</literal> directives can be specified. | |
566 </para> | |
567 | |
568 </directive> | |
569 | |
570 | |
542 <directive name="js_set"> | 571 <directive name="js_set"> |
543 <syntax> | 572 <syntax> |
544 <value>$variable</value> <value>function</value> | | 573 <value>$variable</value> <value>function</value> | |
545 <value>module.function</value></syntax> | 574 <value>module.function</value></syntax> |
546 <default/> | 575 <default/> |