Exforsys.com
 
Home Tutorials JavaScript
 

Working with JavaScript DOM Objects

 

JavaScript HTML DOM Objects

Page 2 of 2

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.



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


Methods of Location Object:

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


First Page: Working with JavaScript DOM Objects


Read Next: JavaScript DOM Window Object



 

 

Comments


bapi_22 said:

  I have more than five image on a web page. but display only one image and a "next" button. How to write javascript sothat on clicking on the next botton the image will come one after another. Kindly help me any one.
July 23, 2007, 4:54 am

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2009 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape