Chapter 10. Page Navigation Techniques
Introduction
No web page is (or should be) an
island. Just as there is a way to reach the page, so should there be
one or more ways to navigate to other destinations, either within the
same site or outside. The HTML hyperlink element—embedded in
pages as the rather nondescript <a>
tag—is the conventional, nonscripted way to provide a clickable
avenue for the user to navigate to another page. But more
sophisticated user interface designs frequently require Dynamic HTML
to assist with the presentation of navigation options and the very
act of navigating.
The location Object
Each window
(and frame) object in every scriptable browser has a
location object whose properties contain
information about the URL of the page currently loaded into the
browser. This is an abstract object, meaning that the object has no
particular physical presence visible on the page—except perhaps
the URL that appears in the browser’s Location or
Address field. But the location object does not
control what the user sees in the Location/Address field unless the
browser succeeds in navigating to a page you assign to the
location object.
Properties of the location object are read/write. The individual properties reveal components of the URL (and even the entire URL) of the loaded page. Without any restrictions to this information, however, scripts could spy on your browser activity without you knowing it. For example, imagine entering an unscrupulous web site that looks like ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access