能否实现如下的功能:(1)先从数据库读取数据(2)在更具focus()展开要制定的节点!在FireFox下可以实现,但在IE中不知道为什么,就是不行!这是什么原因!大家看了要留言哦!期待。

解决方案 »

  1.   

    代码如下:main.jsp<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <%
    String userName = (String)request.getSession().getAttribute("userName");
    String userType = (String)request.getSession().getAttribute("userType");
    %>
    <%
        request.setAttribute("decorator", "none");
        response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
        response.setHeader("Pragma","no-cache"); //HTTP 1.0
        response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        <title>通讯资源管理系统</title>
      </head>
    <frameset cols="200,*" frameborder="yes" border="5" framespacing="5" borderColor="#6EC3C9" >
      <frame src="tree.jsp" name="leftFrame" scrolling="no" id="leftFrame" title="leftFrame"  />
      <frame src="mainright.jsp" name="mainFrame" id="mainFrame" title="mainFrame" />
    </frameset>
    <noframes>
    <body>
    </body>
    </noframes>
    </html>
    这个就是要操作的代码       var pnode=parent.leftFrame.window.tree.currentNode.parentNode;
          alert(parent.leftFrame.window.tree.currentNode.id);
          parent.leftFrame.location.reload();   //刷新tree.jsp页面
          location.replace("http://localhost:8080/ppcm/userInfo.jsp?user_id=wxq&pid=SMFJHJK");   // 右面页面的刷新
          //专门存放左边的页面
          var psid= pnode.sourceIndex;
          //alert(psid);
          var pid = psid.substr(psid.indexOf("_")+1);
          parent.leftFrame.window.tree.focus(pid);