-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
YUI 2.8: Learning the Library
Cookies have become a fact of life on the Internet, every time we run an antivirus it will warn us about dozens of them used to track where we've been and what we've seen. Cookies, however, have very legitimate uses: when a visitor comes back, it is handy to have him/her remembered, return to where he/she left (something the BHM can help with) and restore his/her preferences.
The Cookies Utility has only one class, YAHOO.util.Cookie that cannot be instantiated because, just as with the BHM, as there is only one set of cookies in the browser, it can only have one manager. It has a few methods and no properties or events. The methods are:
.exists(): Tells if a cookie exists
.get(): Reads the value of a cookie
.getSub(): Reads the value of a specific subcookie of a cookie
.getSubs(): Reads the value of all subcookies of a cookie
.remove(): Removes a cookie
.removeSub(): Removes a subcookie
.set(): Sets the value of a cookie
.setSub(): Sets the value of a subcookie
.setSubs...
Change the font size
Change margin width
Change background colour