Assignment 007

JavaScript Properties I

JavaScript is a scripting language that uses objects. For example, your browser window is an object, which contains the document object. We can refer to these objects via JavaScript by using "window.document."

The following includes several properties of the window.document object. These properties are referenced with the following code:

window.document.URL - This property gives the domain name and path on the server or computer
window.document.title - This property gives the title used on the Web page
window.document.lastModified - This property gives the date the Web page was last modified


Here are the window.document properties for this page:

An important side note:

Here's an example of using + (concatination) to join "URL:" and window.document.URL

window.document.write("URL:" + window.document.URL);

Here's the code to display the document properties: