website programmers should be to make the website experience as easy and
pleasant for the user as possible. Clearly, well-designed pages with easily
navigable layout are central to this, but they're not the whole story. We can go
one step further by learning about our users and using information gained about
them to personalize the website.
For example, imagine a user, whose name we asked on the first
visit, returns to our website. We could welcome the user back to the website by
greeting him or her by name. Another good example is given by a website, such as
Amazon's, which incorporates the one-click purchasing system. By already knowing
the user's purchasing details, such as credit card number and delivery address,
we can allow the user to go from viewing a book to buying it in just one click,
making the likelihood of the user purchasing it that much greater. Also, based
on information, such as the previous purchases and browsing patterns of the
user, it's possible to make book suggestions to the user.
Such personalization on websites requires that information
about users be stored somewhere in between their visits to the website. We've
previously talked about the fact that accessing the user's local file system
from a web application is pretty much off limits due to security restrictions
included in browsers. However, we, as website developers, can store small
amounts of information in a special place on the user's local disc, using what
is called a cookie. There may be a logical reason why they
are named cookies.
The term Dynamic HTML DHTML has rather a loose meaning, but essentially its purpose is to allow the
elements and contents of a web page to be dynamically changed after the page has
been loaded into the browser. For example, it can be used to change the size of
text as the mouse pointer rolls over it. However, in addition, it also aims to
enhance user interaction by making many more HTML elements respond to user
actions.
In plain HTML, we can define what a page will contain and the
appearance of its contents. However, after the page is built and downloaded to
the user's browser, that's it. No changes can be made to the page's content or
appearance. However, using DHTML we can change the appearance of existing
content, add new content, and even remove content.