Properties of the HISTORY Object

Readers want to be able to use links that take them back or forward one or more pages by clicking on the buttons at the top of the browser window. The history object only has one property and that is length, which represents the number of URLs in the history list.


Properties of the LOCATION Object

Location is JavaScript for URL, or the address of the page. Out of the list of properties, the two most popular are:

  1. location.host returns the URL plus the port the user is attached to
  2. location.hostname returns only the URL

These two properties are equal in that they both do the same thing: return the URL in either IP number or text format, depending on what format the server is using. If you get the same result with both commands, that means your server has not rounted you to a specific port. In technical terms, the port property is null.

Note: Both location commands will not work if they run from the hard drive. The script has to be running from a server in order to obtain an address for the script to return.

Back Table of Contents Next