[Javascript] IE & NN dom references

Steve White steve at VirtualMechanics.com
Thu Mar 22 05:27:19 CST 2001


Thanks, much appreciated. I will give it a shot.

Yours Truly

Steve White
www.VirtualMechanics.com
www.SVGMagic.com

-----Original Message-----
From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
Behalf Of Peter-Paul Koch
Sent: Thursday, March 22, 2001 6:15 AM
To: javascript at LaTech.edu
Subject: Re: [Javascript] IE & NN dom references





>I want store references to DIV and IMG elements in a common array so that I
>don't have to worry if it came from NN4.x or IE. If I have a DIV like this:
>
><div id="OObj2" STYLE="...stuff...">
><img id="GGeo2" SRC="Geo2.png" alt="something" width=643 height=165>
></div>

if (document.getElementById) // NN6, IE5, Opera 5
{
   ob[1].style = document.getElementById('OObj2').style;
   ob[1].geom = document.getElementById('GGeo2');
}
else if (document.all) // IE4
{
   ob[1].style = document.all['OObj2'].style;
   ob[1].geom = document.all['GGeo2'];
}
else if (document.layers) // NN4
{
  ob[1].style = document.layers['OObj2'];
  ob[1].geom = document.layers['OObj2'].document.images['GGeo2'];
}

ppk

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list