CD-105Chapter 11 (Space web hosting) .Scripting Frames and Multiple Windows //

CD-105Chapter 11 .Scripting Frames and Multiple Windows // end –> Look first at the HTML section for the Body portion. Almost everything there is standard stuff for defining client-side image maps. The coordinates define rectangles around each of the arrows in the larger image. The HREF attributes for the two areas point to JavaScript functions defined in the Head portion of the document. In the frameset that defines the Decision Helper application, names are assigned to each frame. The upper-right frame is called entryForms; the bottom frame is called instructions. Knowing that navigation from page to page in the upper-right frame requires knowledge of which page is currently loaded there, I build some other scripting into both the parent document and each of the documents that loads into that frame. A global variable called currTitleis defined in the parent document. Its value is an integer indicating which page of the sequence (1 through 5) is currently loaded. An onLoadevent handler in each of the five documents (named dh1.htm, dh2.htm, dh3.htm, dh4.htm, and dh5.htm) assigns its page number to that parent global variable. This arrangement allows all frames in the frameset to share that value easily. When a user clicks the right-facing arrow to move to the next page, the goNext() function is called. The first statement gets the currTitle value from the parent window and assigns it to a local variable: currOffset. An if…else construction tests whether the current page number is less than five. If so, the add-by-value operator adds one to the local variable so I can use that value in the next two statements. In those next two statements, I adjust the content of the two right frames. Using the parent reference to gain access to both frames, I set the location.href property of the top-right frame to the name of the file next in line (by concatenating the number with the surrounding parts of the filename). The second statement sets the location.hash property (which controls the anchor being navigated to) to the corresponding anchor in the instructions frame (anchor names help1, help2, help3, help4, and help5). A click of the left-facing arrow reverses the process, subtracting 1 from the current page number (using the subtract-by-value operator) and changing the same frames accordingly. The example shown in Listing 11-1 is one of many ways to script a navigation frame in JavaScript. Whatever methodology you use, much interaction occurs among the frames in the frameset.
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

One Response to “CD-105Chapter 11 (Space web hosting) .Scripting Frames and Multiple Windows //”

  1. Pterker Says:

    Great One…

    I must say, its worth it! My link, http://dress.terapad.com/,thanks haha…

Leave a Reply