[Javascript] Detecting an image on a page

Dan Costea costea.dan at ssi-schaefer.ro
Thu Jun 6 18:52:38 CDT 2002


you can use

var nImgsNr = document.getElementsByTagName ("img").length

and nImgsNr will hold the number of img tags.

Dan.


----- Original Message -----
From: <RFreeman at ncb.org.uk>
To: <javascript at LaTech.edu>
Sent: Thursday, June 06, 2002 2:19 AM
Subject: [Javascript] Detecting an image on a page


> Hi all,
>
> As part of a server-uptime detection system, I want to detect with
> javascript if an image is present on a page that has been pulled from a
> database. Can this be done in Javascript ? Would this be the
> document.images function ? I want to set a variable in the jscript to 1 if
> the image is present and 0 if not - can this be don ?
>
> Thanks for any help,
>
> Richard
> --------------------------------------------------
> web developer - young transnet
> rfreeman at ncb.org.uk
> tel - 020 7843 6098
> fax - 0870 132 0240
> -------------------------------
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list