Exforsys

JavaScript Tutorial

  1. JavaScript Browser Objects Part 2
  2. JavaScript Frame object
  3. JavaScript Form Object
  4. JavaScript FileUpload Object
  5. JavaScript Event Object Properties and Methods
  6. JavaScript Event Object
  7. JavaScript Elements and Embed Objects
  8. JavaScript Applet Objects
  9. JavaScript Browser Objects
  10. JavaScript Object Oriented Features
  11. JavaScript Window Object Open Method Part 2
  12. JavaScript Window Object Open Method
  13. JavaScript Window Object Timeout Methods
  14. JavaScript Location Object
  15. JavaScript Location Object Properties
  16. JavaScript History Object Properties and Methods
  17. JavaScript Document Object Methods Part II
  18. JavaScript Document Object Methods Part I
  19. JavaScript Document Object Properties
  20. JavaScript Document Object
  21. JavaScript Windows Object Properties Part II
  22. JavaScript Windows Object Properties Part I
  23. JavaScript DOM Window Object
  24. Working with JavaScript DOM Objects
  25. JavaScript Array Object Methods – Part II
  26. JavaScript Array Object
  27. JavaScript Array Object Methods – Part I
  28. JavaScript Boolean Object
  29. JavaScript OnError Event
  30. JavaScript Exception Handling – Part II
  31. JavaScript Exception Handling – Part I
  32. JavaScript Event Handler
  33. JavaScript Events Handling
  34. JavaScript Array Operations
  35. JavaScript Two Dimensional Arrays
  36. Passing values to JavaScript Function
  37. JavaScript Functions
  38. JavaScript Arrays
  39. JavaScript Iterative Structures - Part II
  40. JavaScript Iterative Structures - Part I
  41. JavaScript Math Object
  42. JavaScript Date Object
  43. JavaScript String Object
  44. JavaScript Objects
  45. JavaScript Confirm Box
  46. JavaScript Alert Box
  47. JavaScript Conditional Statements Part 2
  48. JavaScript Conditional Statements Part 1
  49. How to use JavaScript in HTML page
  50. JavaScript Variables
  51. JavaScript Features
  52. JavaScript Introduction

Ads


Home arrow Technical Training arrow JavaScript Tutorial

JavaScript HTML DOM Objects

Page 2 of 2
Author : Exforsys Inc.     Published on: 4th Jun 2007    |   Last Updated on: 6th Jun 2007

Working with JavaScript DOM Objects

Screen:

Screen object object contains information about the display screen of the client. The object provides information about the user's video display and color settings. JavaScript runtime engine automatically creates these settings.

There are various properties associated with the Screen object.

Ads

Properties of Screen Object:

  • availHeight
  • availWidth
  • bufferDepth
  • colorDepth
  • deviceXDPI
  • deviceYDPI
  • fontSmoothingEnabled
  • height
  • logicalXDPI
  • logicalYDPI
  • pixelDepth
  • updateInterval
  • width

In the next sections, the usage, syntax and explanation with examples of each of the properties of the Screen object will be discussed.

Navigator:

Navigator object is an object that is automatically created JavaScript runtime engine. Navigator contains information about the client browser.

This object is used to obtain information about the type of browser being used to access the page. Using this information, the user can be directed to a different page or carry out tasks or functions depending upon the user’s browser.

The following list gives some of the properties and methods of the Navigator object.

Properties of Navigator Object:

  • appCodeName

  • appMinorVersion

  • appName

  • appVersion

  • browserLanguage

  • cookieEnabled

  • cpuClass

  • onLine

  • platform

  • systemLanguage

  • userAgent

  • userLanguage

Methods of Navigator Object:

  • javaEnabled()
  • taintEnabled()

History:

Like the Screen Object, the History object is also automatically created object by the JavaScript runtime engine. Browsers store the list of the user’s previously visited URLs. Using this list, the user navigates to previously visited web pages using the back and forward buttons in the browser. This list of URLs is called the browser's history. It's stored in the form of a list that can be accessed by JavaScript. History object can be assessed by using the window.history property. The History object is a part of a Window object.

The following list gives some of the properties and methods of the History object.

Property of History Object:

  • length

Methods of History Object:

  • back()
  • forward()
  • go()

Syntax and explanation with examples of History object properties and methods are discussed in coming sections.

Location:

Location object contains information about the current URL and thus this object provides access and control over the URL of the current window. But one important point to note in this context is that it cannot modify the URL displayed in the browser's address box and thus adds security in its usage. Since it is part of the Window object it is accessed using the window.location property.

Location Object is automatically created by the JavaScript runtime engine. The following list gives some of the properties and methods of the Location object.

Properties of Location Object:

  • hash
  • host
  • hostname
  • href
  • pathname
  • port
  • protocol
  • search

Ads

Methods of Location Object:

  • assign()
  • reload()
  • replace()


 
This tutorial is part of a JavaScript Tutorial tutorial series. Read it from the beginning and learn yourself.

JavaScript Tutorial

  1. JavaScript Browser Objects Part 2
  2. JavaScript Frame object
  3. JavaScript Form Object
  4. JavaScript FileUpload Object
  5. JavaScript Event Object Properties and Methods
  6. JavaScript Event Object
  7. JavaScript Elements and Embed Objects
  8. JavaScript Applet Objects
  9. JavaScript Browser Objects
  10. JavaScript Object Oriented Features
  11. JavaScript Window Object Open Method Part 2
  12. JavaScript Window Object Open Method
  13. JavaScript Window Object Timeout Methods
  14. JavaScript Location Object
  15. JavaScript Location Object Properties
  16. JavaScript History Object Properties and Methods
  17. JavaScript Document Object Methods Part II
  18. JavaScript Document Object Methods Part I
  19. JavaScript Document Object Properties
  20. JavaScript Document Object
  21. JavaScript Windows Object Properties Part II
  22. JavaScript Windows Object Properties Part I
  23. JavaScript DOM Window Object
  24. Working with JavaScript DOM Objects
  25. JavaScript Array Object Methods – Part II
  26. JavaScript Array Object
  27. JavaScript Array Object Methods – Part I
  28. JavaScript Boolean Object
  29. JavaScript OnError Event
  30. JavaScript Exception Handling – Part II
  31. JavaScript Exception Handling – Part I
  32. JavaScript Event Handler
  33. JavaScript Events Handling
  34. JavaScript Array Operations
  35. JavaScript Two Dimensional Arrays
  36. Passing values to JavaScript Function
  37. JavaScript Functions
  38. JavaScript Arrays
  39. JavaScript Iterative Structures - Part II
  40. JavaScript Iterative Structures - Part I
  41. JavaScript Math Object
  42. JavaScript Date Object
  43. JavaScript String Object
  44. JavaScript Objects
  45. JavaScript Confirm Box
  46. JavaScript Alert Box
  47. JavaScript Conditional Statements Part 2
  48. JavaScript Conditional Statements Part 1
  49. How to use JavaScript in HTML page
  50. JavaScript Variables
  51. JavaScript Features
  52. JavaScript Introduction
 

Comments