CD-539Appendix F . Examples from Parts III and (Msn web hosting)
CD-539Appendix F . Examples from Parts III and IV Example The page in Listing 28-2 displays checkboxes for several preference settings plus one text box to show a preference setting value for the size of the browser s disk cache. To run this script without signing the scripts, turn on codebase principals as directed in Chapter 46. (The listing file on the CD-ROM does not employ signed scripts.) One function reads all the preferences and sets the form control values accordingly. Another function sets a preference when you click its checkbox. Because of the interaction among three of the cookie settings, it is easier to have the script rerun the showPreferences()function after each setting rather than you trying to manually control the properties of the three checkboxes. Rerunning that function also helps verify that you set the preference. Listing 28-2: Reading and Writing Browser Preferences