Previous Example-|-Next Example-|-Return to Chapter Listing

Example 15.4:
Using top

The first button won't do anything, because the top doesn't contain a document:

This second button will work, because we can change the top status bar (temporarily, as long as you keep pointing at the button):

But the next works, too, because changing status for any frame changes the status bar:


This is the script we used: <FORM> <INPUT TYPE="button" VALUE="Change top frame to Orange" onclick="top.document.bgColor='orange'"><P> <I>This second button will work, because we can change the top status bar (temporarily, as long as you keep pointing at the button):</I><BR> <INPUT TYPE="button" VALUE="Change Status Bar: top.status=" onclick="top.status='Ah ha, you’ve just changed the status bar.'"><P> <I>But the next works, too, because changing status for any frame changes the status bar:</I><BR> <INPUT TYPE="button" VALUE="Change Status Bar: top.frames[2].status=" onclick="top.frames[2].status='And again.'"> </FORM>
Previous Example-|-Next Example-|-Return to Chapter Listing