spacer

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

home / experts / javascript / column1


Compatibility Issues

Developer News
Cisco Lawsuit: A Test for the GPL?
Shifts for Enterprise Linux, Green Networks in '09
Gifts for All in Linux 2.6.28

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.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

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

webref The latest from WebReference.com Browse >
Overview of Popular JavaScript Frameworks - ASP.NET AJAX · An Introduction to 3D · Email Marketing Terms to Know
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Configuring Anonymous Dialog Security in SQL Server 2005 Express Service Broker Conversation · OpenVPN: Revoking Access and Expanding Management Options · Connecticut Town Lays Groundwork for Merged School, Municipal VoIP Network


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

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