trsands
01-29-2004, 03:45 AM
I have an array of objects..... objArray
each object consists of:
obj.item
obj.quantity
obj.price
to access and element i refer to it as
objArray[i].price etc...
I want to pass objArray[i] to a funtion then within the function reference the elements
e.g.
function printobj(prtobj)
{
document.write(prtobj.price;
}
....
printobj(objArray[2])
...
or If I try to create a variable
var pobj = objArray[3]
printobj(pobj)
......
for some reason it rejects this
each object consists of:
obj.item
obj.quantity
obj.price
to access and element i refer to it as
objArray[i].price etc...
I want to pass objArray[i] to a funtion then within the function reference the elements
e.g.
function printobj(prtobj)
{
document.write(prtobj.price;
}
....
printobj(objArray[2])
...
or If I try to create a variable
var pobj = objArray[3]
printobj(pobj)
......
for some reason it rejects this