strict warning: Only variables should be assigned by reference in /home/itechpros/servoyguy.com/sites/all/modules/links/links.inc on line 1434.

Working with Objects

//create a new Object 
var myObject = new Object()
//add properties to the element 
myObject.myProperty = "something" 
//make it multi-dimensional by addition additional properties
myObject.secondObject = new Object() 
//add more stuff 
myObject.secondObject.secondProperty = "something else" 
//loop through items in the object 
for(var curElement in myObject)
{ 
application.output(curElement) 
} 
//reference object dynamically.  These 2 lines are the same 
application.output(myObject.myProperty) 
application.output(myObject['myProperty']) 
//and, even reference the multidimensional object 
application.output(myObject['secondObject']['secondProperty'])
//When your done, if you need to store this object, you can just set it to a global
globals.objectStorage = myObject //you'll need to create the objectStorate global
//now, you can use the global later, just like you use myObject
application.output(globals.objectStorage['myProperty'])