role.jsp
<iframe id="EmployeeList" src="staticTree.jsp">
</iframe>
我怎样才能取得staticTree.jsp页面的值呢??????下面为staticTree.jsp里面的树..
|-CSDN积分制论坛
|    -程序人生
|    -Java
|    -Oracle
|          -Oracle 技术群交流如果我要取得    程序人生   这个节点的值,该怎么做???????

解决方案 »

  1.   

    可以这样
     var fr =  document.frames("EmployeeList");
     var content = fr.document.getElementById("你取值的id").value;
      

  2.   

    同四楼如果  staticTree.jsp 里面 getValue()能够得到“程序人生” 这个节点的值
     //得到“程序人生” 这个节点的值
    function getValue(){
        return ......
    }
    role.jsp  :
    alert(EmployeeList.getValue())
      

  3.   

    //---------------tree.html--------------------------------
    <html>
    <head>
    <script type="text/javascript">
        var tree = "123456";
    </script>
    </head>
    <body>
    姓名:<input type="text" id="name"/>
    </body>
    </html>
    //-----------------主页---------------------------------------
    <html>
    <head>
    <script type="text/javascript">
        function show(){
            alert("javascript变量:" + parent.frames["EmployeeList"].tree);
            alert("表单元素-姓名: " + parent.frames["EmployeeList"].document.getElementById("name").value);
        }
    </script>
    </head>
    <iframe id="EmployeeList" src="tree.html"> 
    </iframe>
    <input type="button" value="取值" onclick="show()"/>
    </html>