Chapter 17. Location and History Objects
IN THIS CHAPTER
Loading new pages and other media types via the location object
Security restrictions across frames
Navigating through the browser history under script control
Not all objects in the document object model are things you can see in the content area of the browser window. Each browser window or frame maintains a bunch of other information about the page you are currently visiting and where you have been. The URL of the page you see in the window is called the location, and browsers store this information in the location object. As you surf the Web, the browser stores the URLs of your past pages in the history object. You can manually view what that object contains by looking in the browser menu that enables you to jump back to a previously visited page. This chapter is all about these two nearly invisible, but important, objects.
These objects are not only valuable to your browser, but also valuable to snoopers who might want to write scripts to see what URLs you're viewing in another frame or the URLs of other sites you've visited in the past dozen mouse clicks. As a result, security restrictions built into browsers limit access to some of these objects' properties (unless you use signed scripts in NN4+/Moz). For older browsers, these properties simply are not available from a script.
location Object
Properties | Methods | Event Handlers |
|---|---|---|
|
| None |
|
| |
|
| |
| ||
| ||
| ||
| ||
|
Syntax
Loading ...
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