日期:2014-05-20  浏览次数:20656 次

用ajax怎么定时刷新dtree!急需解决
我是这么写的!怎么刷新页面没有什么效果

我的结构流程就是 首先点击树形图的节点,跳进servlet中,执行查询的方法。然后有调回该页面。页面刷新没有什么反应。
各位帮我解决一下!谢谢各位了!急需解决呀!

首先是frame页面 代码如下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title></title>
<link href="images/css.css" rel="stylesheet" type="text/css" />
</head>
<frameset cols="45%,*,0" frameborder="no" border="0" framespacing="0">
  <frame src="devgroupmng_l.jsp" name="left" scrolling="no" noresize="noresize" id="left" />
  <frame src="devgroupmng_f.jsp" name="right" scrolling="auto" noresize="noresize" id="right" />
  <frame name="ddhidden" src="" />
</frameset>
<noframes><body>
</body>
</noframes></html>


左边页面devgroupmng_l.jsp是用dtree写的页面。就是树形图 部分代码如下

 <script type="text/javascript">
  d = new dTree('d');
  <%
  System.out.println("abcde");
  GetGroup dao=new GetGroup();
  Vector arr=new Vector();
  GetDev getdev=new GetDev();
  List list=new ArrayList();
  List camera=new ArrayList();
  camera=(List)request.getAttribute("camera");
  DevGroupInfo vo=new DevGroupInfo();
  GetCamera getcamera=new GetCamera();
  camera=getcamera.getcamerainfo();
  CameraStatus cs=new CameraStatus();
  CameraInfo camerainfo=new CameraInfo();
  list=getdev.getonlinedev();
  arr=dao.getGroupInfo();
  for(int i=0;i<arr.size();i++)
  {
  vo=new DevGroupInfo();
  vo=(DevGroupInfo)arr.get(i);
  if(vo.getDevId()==null||"".equals(vo.getDevId())){
  %>
  d.add('<%=vo.getGroupId()%>','<%=vo.getGroupParentId()%>','<%=vo.getGrouopName()%>',
  '','','_target','img/tree.gif','img/tree.gif');
  <%
  }else{
  for(int k=0;k<camera.size();k++){
  camerainfo=new CameraInfo();
  camerainfo=(CameraInfo)camera.get(k);
  %>
  IP='<%=camerainfo.getCameraip()%>';
  cameraId='<%=camerainfo.getCameraid()%>';
  port='<%=camerainfo.getConport()%>';
  <%
  if(vo.getDevId().equals(camerainfo.getCameraid().substring(0,10))){
  if(camerainfo.getStatus().equals("1")){  
  %>
  d.add('<%=vo.getGroupId()%>','<%=vo.getGroupParentId()%>','<%=vo.getGrouopName()%>',