Generating our application's content area

If you have read the previous sections of this chapter, you have a pretty good grasp of what module augmentation is by now. You also know of a couple of techniques to add dynamic properties to our modules using augmentation.

As it stands, our application (Images Inc.) has code that dynamically generates the header and footer sections of our pages. But we still have an empty space in the middle (the content area), which needs to be populated with content.

Let's put the techniques that we have learned in this chapter to good use and add functionality to our application that will generate the content area dynamically.

Note that the refactored augmenting code in Modules_3.js is now as follows:

(function(originalModule){ ...

Get Modular Programming with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.