Potential Extensions

Even a little bit of creativity can take you places with this application. Here are a few of the possibilities that come to mind:

  • Add fields to manipulate table cell background colors and font colors, and other elements for the layout look.

  • Allow users to choose entire page themes.

  • Add a couple of extra text fields so that the user can add his or her own favorite web site links (with names).

  • Post banner ads according to the user’s cookie preferences.

More Choices for the Layout Look

Users like lots of choices. Anything you can tweak on the user’s page can be manipulated. This includes content and graphics in layers, other frames, and remote windows.

Adding Themes

This idea stems from Windows 95’s desktop themes. Instead of letting users pick individual items, such as font face, size, and color, why not offer a couple of layout themes that make the choices all at once? Suppose you have a music-related web site. Consider the following select list:

<SELECT NAME="themes"onChange="swapImage('theImage',
   this.options[this.selectedIndex].value);">
<OPTION VALUE="none">None
<OPTION VALUE="bigband">Big Band
<OPTION VALUE="rocknroll">Rock 'n Roll
<OPTION VALUE="rap">Rap
<OPTION VALUE="country">Country
<OPTION VALUE="reggae">Reggae
<OPTION VALUE="grunge">Grunge
<OPTION VALUE="jazz">Jazz
<OPTION VALUE="club">Club Music
</SELECT>

Each of those OPTION values could relate to a thumbnail image of the potential theme. You can even use genSelect() and swapImage() in prefs.html ...

Get JavaScript Application Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.