Scripts That Write Scripts

Up to this point, you have seen how to make changes by sending variables to different frames in a frameset. By passing variables between frames, you can basically establish communication between more than a single HTML page within a frameset. That is an important part of JavaScript, but what if you could dynamically alter an entire page? You could change everything from the text that appears on the screen to the entire layout of the page. This section shows how to do that.

Writing Elsewhere

Throughout the book, you have seen examples of using document.write() to place formatted text on a page. You can use the same method to write tags to create an entire page by addressing a document other than the one that you are ...

Get JavaScript Design 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.