spacer

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

home / experts / javascript / column1


Compatibility Issues

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


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

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