eBob.com wrote:
> I am so frustrated. I've been working all weekend on what I thought would
> be a simple script. I never find it easy to look at someone else's code,
> but if someone can help with this I would be very grateful. The script is
> ...
>
> <script type="text/javascript">
> var parentwin = external.menuArguments;
> var doc = parentwin.document;
> var x = doc.getElementsByTagName("table")
> alert(x.length + " table things")
> var re = /class='class_18'>(\w+)<\/td>/
>
> for (iv in x)
x is a DOM node list, don't use for..in with that, use a for loop
for (var i = 0, l = x.length; i < l; i++)
{
var table = x[i];
}
for..in enumerates enumerable properties of an object and that is
usually not the right way to iterate over DOM collections.
--
Martin Honnen
http://JavaScript.FAQTs.com/