JavaScript Bible, Gold Edition part 178. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | CD-262 Part VI Appendixes Listing 16-8 continued SCRIPT LANGUAGE JavaScript function gatherWindowData var msg msg B From the point of view of this frame B BR msg BR msg P msg B From the point of view of the framesetting document B BR msg BR msg 0 .name 0 .name return msg SCRIPT HEAD BODY SCRIPT LANGUAGE JavaScript gatherWindowData SCRIPT BODY HTML Figure 16-5 Property readouts from both frames loaded from Listing 16-7 Appendix F Examples from Parts III and IV CD-263 The last statement in the example shows how to use the array syntax brackets to refer to a specific frame. All array indexes start with 0 for the first entry. Because the document asks for the name of the first frame 0 the response is JustAKidl for both frames. innerHeight innerWidth outerHeight outerWidth NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Example In Listing 16-9 a number of buttons let you see the results of setting the innerHeight innerWidth outerHeight and outerWidth properties. Listing 16-9 Setting Window Height and Width HTML HEAD TITLE Window Sizer TITLE SCRIPT LANGUAGE JavaScript store original outer dimensions as page loads var originalWidth var originalHeight generic function to set inner dimensions function setInner width height width height generic function to set outer dimensions function setOuter width height width height Continued CD-264 Part VI Appendixes Listing 16-9 continued restore window to original dimensions function restored originalWidth originalHeight SCRIPT HEAD BODY FORM B Setting Inner Sizes B BR INPUT TYPE button VALUE 600 Pixels Square onClick setInner 600 600 BR INPUT TYPE button VALUE 300 Pixels .