Chapter 7. Cookie-Based User Preferences

Application FeaturesJavaScript Techniques
• Modifiable Links, Background Images, and Font Settings• Naming Conventions Pay Off Again
• Flexible User Preference Application• Dynamic DHTML
• Dozens of Layout Combinations 
• Easily Customized for Language Preferences, Colors, Images, and DHTML 

This chapter contains a worthless application, but don’t flip to the next one yet. Did I mention that the code in this one can help you add some of the coolest functionality to your web site? I’m talking about setting user preferences. Consider this. What’s the one word every user has on his or her mind while surfing the Web?

“Me.”

Yes, users are a selfish bunch, always thinking about their concerns and interests, rather than yours. Whatever people do, they always tend to seek things that remind them of themselves. That’s why DHTML freaks hang out at the Dynamic HTML Zone (http://www.dhtmlzone.com/), shoppers go to Shopping.com (http://www.shopping.com/ibuy/), and astronomy geeks (that would be me. See? I’m doing it right now) visit the Sky & Telescope site (http://www.skypub.com/). Marketers, advertisers, and salespeople have capitalized on this for centuries. The Web is no different. Using a fictitious application, this chapter shows you how to add personalization of functionality to your site, even if it’s as simple as remembering a username. Using JavaScript cookies, visitors will be able to customize their experience on ...

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.