• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

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 using to write the JavaScript. Using the window.open() method, you can open a new window or target an existing one other than the one that you are using to write your script. The open() method has four arguments:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint