[Javascript] non-html object creation
Mike Dougherty
mdougherty at pbp.com
Fri Apr 16 08:17:53 CDT 2004
>2. There is no built in reference to an objects "parent"/owner, but you can quite easily build
>that kind of relation while constructing your data set. I think the above link will throw you a
>good way in the right direction.
something like:
loMainItem.Item0200[1] = new Item0200( loMainItem, *params*)
function Item0200 (toParent) {
this.parent = toParent
*etc*
}
This works because javascript is passing an object pointer, which is then assigned to the newly
created object property. Future references to loMainItem.Item0200[1].parent would reference the
loMainItem object, correct?
thanks for your help
More information about the Javascript
mailing list