Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

If (document.images)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Guest's Avatar
    Guest replied
    If (document.images)

    Chris, Images is one of document object's property. It basically is an array of images and information about images store in document object. This infomation include the image loading status, width, height, source, and so on. Generally, the if(doucument.images) is used to check whether the browser is support other object (method). For example, if you want to replace the current url with the new one in your browser history, function go(url) { if (document.images) location.replace(url); else location.href = url; } As you can see, you can use either location.href=url or location.replace(url). However, replace() as well as document.images only work with IE 4.0 or higher and Netscape 3.0 or higher. So using if(document.images) to check for image object is the easiest way to detect whether the browser support the location object replace() method. Shawn Fu

    Leave a comment:


  • Guest's Avatar
    Guest started a topic If (document.images)

    If (document.images)

    I've searched the internet far and wide and can't find an explanation of what this simple statement does in Javascript: If (document.images) Does this test if the browser is capable of showing images (ie: the option to show images is disabled)? Does this test if images are still loading? Thanks. Chris
Working...
X