39
edits
Petermichaux (talk | contribs) |
Petermichaux (talk | contribs) |
||
| Line 167: | Line 167: | ||
== Browser Sharable as Written == | == Browser Sharable as Written == | ||
It would be handy to be able to share modules "as written" with the browser loading the scripts with html script tags. I think the following source code allows this feature. The first and last lines of the modules would be idiomatic boilerplate for modules to be shared on both the client and server. | It would be handy to be able to share modules "as written" with the browser loading the scripts with html script tags. I think the following source code allows this feature. The first and last two lines of the modules would be idiomatic boilerplate for modules to be shared on both the client and server. | ||
Note that "modules" is some global supplied on the browser's global object. "exports" is not a property of the browser's global object. | Note that "modules" is some global supplied on the browser's global object. "exports" is not a property of the browser's global object. | ||
edits