spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column1


Compatibility Issues

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

As you probably know, not all JavaScript-enabled browsers support the document.images object. In fact, only Navigator 3.0x, 4.0x, and Internet Explorer 4.0x can feature rollovers. The easiest way to make sure the user is running a browser that supports the document.images object is to use a conditional statement:

if (document.images) {
  .
  .
  .
}

This statement determines whether or not the document.images object exists. If the object does not exist document.images is null, so it evaluates to false when used in a conditional statement. On the contrary, if an object is not null, it evaluates to true in a conditional statement. In Column 6, Browser Compatibility, we discuss object detection in detail.

You must be sure not to deal with document.images or the Image object unless document.images (or window.Image) exists. If you want to execute a function's statements provided that document.images is supported, you may:

  • place the statements in a compound if statement.
  • terminate the function with the return command if document.images isn't supported.

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


Created: August 21, 1997
Revised: March 30, 1998

URL: http://www.webreference.com/js/column1/compatible.html