在jsp 中加了一个 dtree 用来显示树状结构,结果发现不能实现onclick事件,只能是以链接的形式在另一页中打开,请问有没有 谁改过这个js 发给我一份吧 我邮箱 [email protected] ,或者告诉我怎么改也行,

解决方案 »

  1.   

    我用过 xtree 没用过 dtree
      

  2.   

    <body>
    ....
    <script type="text/javascript">
    d = new dTree('d'); d.add(0,-1,'My example tree');
    d.add(1,0,'Node 1','example01.html');
    d.add(2,0,'Node 2','example01.html');
    d.add(3,1,'Node 1.1','example01.html');
    d.add(4,0,'Node 3','example01.html');
    d.add(5,3,'Node 1.1.1','example01.html');
    d.add(6,5,'Node 1.1.1.1','example01.html');
    d.add(7,0,'Node 4','example01.html');
    d.add(8,1,'Node 1.2','example01.html');
    d.add(9,0,'My Pictures','example01.html','Pictures I\'ve taken over the years','','','img/imgfolder.gif');
    d.add(10,9,'The trip to Iceland','example01.html','Pictures of Gullfoss and Geysir');
    d.add(11,9,'Mom\'s birthday','example01.html');
    d.add(12,0,'Recycle Bin','example01.html','','','img/trash.gif'); document.write(d);
    </script>
    .....
    </body>创建dtree的时候不要写在函数里,写函数里就不好使了!
      

  3.   


    请问 onclick 事件你添加到哪里了,我怎么找不到呀?
      

  4.   

    应该在<script type="text/javascript" src="dtree.js"></script>
      

  5.   

    指定ONCLICK事件时不能有TARGET参数。第六个
      

  6.   

    指定ONCLICK事件时不能有TARGET参数。第六个
    就是这样操作的!绝对没有错!