R
Richard Trahan
I'm a js newbie, and I'm sure I'm missing something; please help me
find it.
Consider these fragments:
function reconstruct_select_node(selectnode,nodearray) {
alert("120: "+typeof(selectnode));
newselnode = selectnode.cloneNode(false); // shallow clone
... (operations only on newselnode)
alert("139: "+typeof(selectnode));
return newselnode;
}
....
ar = new Object();
ar.selectgraphsnode = (some node object)
....
alert("405: " + typeof(ar.selectgraphsnode));
newselnode = reconstruct_select_node(ar.selectgraphsnode,sna);
alert("407: " + typeof(ar.selectgraphsnode));
The alerts at lines 120, 139, and 405 report type "Object", but
the alert at line 407 is "undefined".
I have an easy workaround for this, but I'd like to understand
what is happening.
Any help, please. Thanks.
find it.
Consider these fragments:
function reconstruct_select_node(selectnode,nodearray) {
alert("120: "+typeof(selectnode));
newselnode = selectnode.cloneNode(false); // shallow clone
... (operations only on newselnode)
alert("139: "+typeof(selectnode));
return newselnode;
}
....
ar = new Object();
ar.selectgraphsnode = (some node object)
....
alert("405: " + typeof(ar.selectgraphsnode));
newselnode = reconstruct_select_node(ar.selectgraphsnode,sna);
alert("407: " + typeof(ar.selectgraphsnode));
The alerts at lines 120, 139, and 405 report type "Object", but
the alert at line 407 is "undefined".
I have an easy workaround for this, but I'd like to understand
what is happening.
Any help, please. Thanks.