Results 1 to 3 of 3

Thread: JavaScript variables in frames [Resolved]

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2002
    Location
    London
    Posts
    63

    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?

    Last edited by Genie; Jun 21st, 2004 at 04:58 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width