chirs said:
Hi, I am following an example of an array in
http://www.faqs.org/docs/htmltut/ima...amsupp_59.html. Here
is a part of the code:
var rollOverArr=new Array();
function rollover(pageImageName)
{
if (! document.images) return;
if (! rollOverArr[pageImageName]) return;
if (! rollOverArr[pageImageName].outImg)
{
My questions are:
1 what does (! document.images) means?
2 where does .outImg come from?
The "!" operator is the negation operator. It doesn't make sense to
negate the document.images object, so it is first converted to a type
that can be negated. The simple rule for converting an object to a
type that can be negated is that if it exists, it is true, and if it
doesn't exist, it is false.
That first line says, "If there no document.images object exists in
this page, return (because this browser, under the current settings,
doesn't support images).
You didn't show us the code where outImg is defined. It seems to
be an attribute of whatever object type is stored in the array.