I'm creating objects from an XML file (code below)
my problem is: How do I evaluate "level" and "parent" so that they are seen as objects ? I have tried eval(parent) but with no success
This is the call with xml (variables are dynamic)
level = new mMenu(name,url,parent); # as is
This would be the code without xml
tA = new mMenu("Alpha","",""
;
dLevel = new mMenu("myname","
tooltip = rootChild.firstChild.childNodes.childNodes.toString();
tooltip = urlDecode(tooltip);
level = rootChild.firstChild.childNodes.attributes.level;
name = String(rootChild.firstChild.childNodes.attributes.name);
url = String(rootChild.firstChild.childNodes.attributes.url);
parent = rootChild.firstChild.childNodes.attributes.parent;
level = new mMenu(name,url,parent);
my problem is: How do I evaluate "level" and "parent" so that they are seen as objects ? I have tried eval(parent) but with no success
This is the call with xml (variables are dynamic)
level = new mMenu(name,url,parent); # as is
This would be the code without xml
tA = new mMenu("Alpha","",""
dLevel = new mMenu("myname","
tooltip = rootChild.firstChild.childNodes.childNodes.toString();
tooltip = urlDecode(tooltip);
level = rootChild.firstChild.childNodes.attributes.level;
name = String(rootChild.firstChild.childNodes.attributes.name);
url = String(rootChild.firstChild.childNodes.attributes.url);
parent = rootChild.firstChild.childNodes.attributes.parent;
level = new mMenu(name,url,parent);