JavaScript variables in frames [Resolved]
I need to access variables from a iframe.
I have a main frame which is the frameset and a content frame. In the main frame I have added a reference to a function
imges = null; // Single instance of class
function Imges() {
this.treeDashedPlus = null;
this.treeDashedMinus = null;
}
and added this in the body:
imges = new Imges();
imges.treeDashedMinus = '/images/tree/dashed/customminus.gif';
imges.treeDashedPlus = '/images/tree/dashed/customplus.gif';
on my content frame page I have a tree which when a node is clicked it calls a onTreeClick() javascript function, which has the following to set the node images
var imges = document.imges;
var src = node.collapsed ? imges.treeDashedMinus : imges.treeDashedPlus;
when I debug this the document.imges is shown as undefined.
What amd I doing wrong or is there another way to read variable from the main frame from within the content frame?
:blush: