39
edits
Petermichaux (talk | contribs) |
Petermichaux (talk | contribs) |
||
| Line 169: | Line 169: | ||
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. | 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. It could have a fancy name that will not likely collide with anything else like "$$$modules__$". | Note that "modules" is some global supplied on the browser's global object. It could have a fancy name that will not likely collide with anything else like "$$$modules__$". Likewise, the "mod" identifier could be fancier. | ||
// ================================================================== | // ================================================================== | ||
edits