Re: About the DOM document object
- From: "Tom Cole" <tcole6@xxxxxxxxx>
- Date: 30 Mar 2007 06:21:42 -0700
On Mar 29, 3:49 pm, Lee <REM0VElbspamt...@xxxxxxx> wrote:
Drae...@xxxxxxxxx said:
In an if statement with "document.images" as it's expression, does it
simply check if there are any image elements in an HTML page? I'm
assuming if it finds any that the expression will return true and
execute the statements within the if.
if(document.images)
{
// various statements....
}
No, there don't have to be any images on the page for document.images
to evaluate to true. The browser simply has to support images (and in
some cases, images may have to be enabled).
--
You can call document.images.length and if it returns 0 then there are
no images, if it returns >= 1 then there are.
if (document.images.length > 0) {
//do image stuff
}
else {
//do no image stuff
}
.
- Follow-Ups:
- Re: About the DOM document object
- From: Une Bévue
- Re: About the DOM document object
- References:
- About the DOM document object
- From: Draenox@xxxxxxxxx
- Re: About the DOM document object
- From: Lee
- About the DOM document object
- Prev by Date: Question about #text
- Next by Date: window.opener lost in postback
- Previous by thread: Re: About the DOM document object
- Next by thread: Re: About the DOM document object
- Index(es):
Relevant Pages
|