tailieunhanh - JavaScript Bible, Gold Edition part 73
JavaScript Bible, Gold Edition part 73. 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. | Text-Related Form Objects The document object model for forms includes four text-related user interface objects text password and hidden INPUT element objects plus the TEXTAREA element object. All four of these objects are used for entry display or temporary storage of text data. While all of these objects can have text placed in them by default as the page loads scripts can also modify the contents of these objects. Importantly all but the hidden objects retain their user- or script-modified content during a soft reload for example clicking the Reload button except in IE3. Hidden objects revert to their default values on all reloads in all browsers. A more obvious difference between the hidden object and the rest is that its invisibility removes it from the realm of user events and actions. Therefore the range of scripted possibilities is much smaller for the hidden object. The persistence of text and TEXTAREA object data through reloads and window resizes makes these objects prime targets for off-screen storage of data that may otherwise be stored temporarily in a cookie. If you create a frame with no size for example you set the COLS or ROWS values of a FRAMESET tag to let all visible frames occupy 100 percent of the space and assign the rest to the hidden frame you can populate the frame with fields that act as shopping cart information or other data holders. Therefore if users have cookies turned off or don t usually respond affirmatively to cookie requests your application can still make use of temporary client storage. The field contents may survive unloading of the page but whether this happens and for how many navigations away from the page the contents last depends on the visitor s cache settings or if the browser is IE3 in which case no values preserve the unloading of a document . If the user quits the browser or closes the browser window the field entry is lost. In This Chapter Capturing and modifying text field contents Triggering action by entering .
đang nạp các trang xem trước