Chapter 23. Cookies and Creating Your Own Objects

Cookies and Creating Your Own Objects

In this chapter, we’ll take a look at two topics near and dear to the JavaScript programmer’s heart: using cookies and creating your own objects.

Everyone knows about cookies—they’re those data items that you can store on someone’s computer. You can store everything from the users’ name (if they give it to you) to the current items they’ve purchased and how much their total is. Using cookies is easier than you might think in JavaScript, and we’ll take a look at how to work with them in this chapter. We’ll see not only how to create and store a cookie, but also what’s involved in reading them at a ...

Get Inside JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.