I'm trying to get the properties for the following objects:


0: [object Object]
1: [object Object]
2: [object Object]
3: [object Object]

This was generated by using the following code:

var s = ""; 
for (var property in this.oProducts.Product)
{
   s = s + "\n "+property +": " + this.oProducts.Product[property] ;
}                 
prompt("test",s);

Since object names can't simply be a number ie(this.oProducts.Product.0), how can I access the object properties in the list above?

Thanks

I would guess that this.oProducts.Product is an array or array-like object (such as a DOM collection) or a regular js object populated with properties named 1,2,3,4.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.