Skip to content

Commit d9e8208

Browse files
Christywlrogerwang
authored andcommitted
[doc] Update 'JavaScript Contexts in NW.js.md'
1 parent 2713947 commit d9e8208

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/For Users/Advanced/JavaScript Contexts in NW.js.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Different windows and frames have different contexts. So when you create a new f
4646

4747
Some objects of Node context are copied to Browser context so that scripts running in Browser context can access Node.js objects:
4848

49-
* `nw` -- the object of all [NW.js APIs](../../References)
49+
* `nw` -- the object of all NW.js APIs in **`References`** section
5050
* `global` -- the global object of Node Context; same as `nw.global`
5151
* `require` -- the `require()` function for loading Node.js modules; similar to `nw.require()`, but it also supports `require('nw.gui')` to load NW.js API module.
5252
* `process` -- the [process module](https://nodejs.org/api/globals.html#globals_process) of Node.js; same as `nw.process`
@@ -74,7 +74,7 @@ Scripts running in the Node context can use [JS builtin objects]() like browse
7474
**All node modules shares a same Node context in separate context mode**. But you have several ways to create new Node contexts:
7575

7676
* Set `new_instance` option to `true` when creating window with [`Window.open()`](../../References/Window.md#windowopenurl-options-callback)
77-
* Start NW.js with `--mixed-context` CLI option to turn NW.js into [Mixed Context mode](#mixed-context)
77+
* Start NW.js with `--mixed-context` CLI option to turn NW.js into [Mixed Context mode](#mixed-context-mode)
7878

7979
#### Access Browser and NW.js API in Node Context
8080

@@ -96,7 +96,7 @@ In the browser side (index.html):
9696
<script>
9797
var myscript = require('./myscript');
9898
// pass the `el` element to the Node function
99-
myscript.setText(document.getElementbyId('el'));
99+
myscript.setText(document.getElementById('el'));
100100
// you will see "hello" in the element
101101
</script>
102102
```
@@ -110,7 +110,7 @@ Relative paths in node modules are resolved according to path of that module (li
110110

111111
## Mixed Context Mode
112112

113-
Mixed context is introduced in NW.js 0.13. When running NW.js with [`--mixed-context` CLI option](../../References/Command Line Options.md#mixedcontext), a new Node context is created at the time of each browser context creation and running in a same context as browser context, a.k.a. the Mixed context.
113+
Mixed context is introduced in NW.js 0.13. When running NW.js with [`--mixed-context` CLI option](../../References/Command Line Options.md#-mixed-context), a new Node context is created at the time of each browser context creation and running in a same context as browser context, a.k.a. the Mixed context.
114114

115115
### Load Script in Mixed Context Mode
116116

0 commit comments

Comments
 (0)