请给我XML代码中加个连接吧[刚刚的帖子发错地方了]
时间:2007-04-09
来源:互联网
<DSTree text="第一节" href="http://" target="frmright" treeId="4353" />
这个http://加内容后不能点击
现在代码很完善,但是所有的连接加上去都不能打开新页面 高手帮忙
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> DSTree </TITLE>
<META NAME="Author" CONTENT="[email protected]" >
<style>
td{font:12px verdana}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
overflow-x : hidden;
SCROLLBAR-FACE-COLOR: #fcb424;
SCROLLBAR-HIGHLIGHT-COLOR: #fcb448;
SCROLLBAR-SHADOW-COLOR: #fc9000;
SCROLLBAR-3DLIGHT-COLOR: #fc9048;
SCROLLBAR-ARROW-COLOR: #fcfcfc;
SCROLLBAR-TRACK-COLOR: #fcfcfc;
SCROLLBAR-DARKSHADOW-COLOR: #fc9000;
SCROLLBAR-BASE-COLOR: #fcfcfc
}
</style>
<script>
//code by star 20003-4-7
var HC = "color:#990000;border:1px solid #cccccc";
var SC = "background-color:#efefef;border:1px solid #cccccc;color:#000000;";
var IO = null;
function initTree(){
var rootn = document.all.menuXML.documentElement;
var sd = 0;
document.onselectstart = function(){return false;}
document.all.treeBox.appendChild(createTree(rootn,sd));
}
function createTree(thisn,sd){
var nodeObj = document.createElement("span");
var upobj = document.createElement("span");
with(upobj){
style.marginLeft = sd*10;
className = thisn.hasChildNodes()?"hasItems":"Items";
innerHTML = "<img src=expand.gif class=ec>" + thisn.getAttribute("text") +"";
onmousedown = function(){
if(event.button != 1) return;
if(this.getAttribute("cn")){
this.setAttribute("open",!this.getAttribute("open"));
this.cn.style.display = this.getAttribute("open")?"inline":"none";
this.all.tags("img")[0].src = this.getAttribute("open")?"expand.gif":"contract.gif";
}
if(IO){
IO.runtimeStyle.cssText = "";
IO.setAttribute("selected",false);
}
IO = this;
this.setAttribute("selected",true);
this.runtimeStyle.cssText = SC;
}
onmouseover = function(){
if(this.getAttribute("selected"))return;
this.runtimeStyle.cssText = HC;
}
onmouseout = function(){
if(this.getAttribute("selected"))return;
this.runtimeStyle.cssText = "";
}
oncontextmenu = contextMenuHandle;
onclick = clickHandle;
}
if(thisn.getAttribute("treeId") != null){
upobj.setAttribute("treeId",thisn.getAttribute("treeId"));
}
if(thisn.getAttribute("href") != null){
upobj.setAttribute("href",thisn.getAttribute("href"));
}
if(thisn.getAttribute("target") != null){
upobj.setAttribute("target",thisn.getAttribute("target"));
}
nodeObj.appendChild(upobj);
nodeObj.insertAdjacentHTML("beforeEnd","<br>")
if(thisn.hasChildNodes()){
var i;
var nodes = thisn.childNodes;
var cn = document.createElement("span");
upobj.setAttribute("cn",cn);
if(thisn.getAttribute("open") != null){
upobj.setAttribute("open",(thisn.getAttribute("open")=="true"));
upobj.getAttribute("cn").style.display = upobj.getAttribute("open")?"inline":"none";
if( !upobj.getAttribute("open"))upobj.all.tags("img")[0].src ="contract.gif";
}
for(i=0;i<nodes.length;cn.appendChild(createTree(nodes[i++],sd+1)));
nodeObj.appendChild(cn);
}
else{
upobj.all.tags("img")[0].src ="endnode.gif";
}
return nodeObj;
}
window.onload = initTree;
</script>
<script>
function clickHandle(){
// your code here
}
function contextMenuHandle(){
event.returnValue = false;
var treeId = this.getAttribute("treeId");
// your code here
}
</script>
</HEAD>
<BODY>
<xml id=menuXML>
<?xml version="1.0" encoding="GB2312"?>
<DSTreeRoot text="体育新课程标准" open="true" href="http://" treeId="123">
<DSTree text="第一篇" open="false" treeId="">
<DSTree text="第一章" open="false" href="http://" target="box" treeId="12">
<DSTree text="第一节" href="http://" target="frmright" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="第二章" open="false" href="http://" target="box" treeId="213">
<DSTree text="第一节" href="http://" target="box" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="第三章" open="false" href="http://" target="box" treeId="432">
<DSTree text="第一节" href="http://" target="box" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
</DSTree>
</DSTree>
<DSTree text="第二篇" open="false" treeId="">
<DSTree text="第一章" open="false" href="http://" target="box" treeId="12">
<DSTree text="第一节" href="http://" target="box" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="第二章" open="false" href="http://" target="box" treeId="213">
<DSTree text="第一节" href="http://" target="box" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="第三章" open="false" href="http://" target="box" treeId="432">
<DSTree text="第一节" href="http://" target="box" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
<DSTree text="第一节" href="" target="box" treeId="2312" />
<DSTree text="第一节" href="" target="box" treeId="2312" />
</DSTree>
</DSTree>
</DSTreeRoot>
</xml>
<table style="position:absolute;left:1px;top:17px;" width="208">
<tr><td id=treeBox style="width:194px;height:200px;border:1px padding-left:5; padding-right:3; padding-top:5; padding-bottom:3" valign=top></td></tr>
<tr><td style="font:10px verdana;color:#999999" align=right> </td></tr>
</table>
</BODY>
</HTML>
这个http://加内容后不能点击
现在代码很完善,但是所有的连接加上去都不能打开新页面 高手帮忙
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> DSTree </TITLE>
<META NAME="Author" CONTENT="[email protected]" >
<style>
td{font:12px verdana}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
overflow-x : hidden;
SCROLLBAR-FACE-COLOR: #fcb424;
SCROLLBAR-HIGHLIGHT-COLOR: #fcb448;
SCROLLBAR-SHADOW-COLOR: #fc9000;
SCROLLBAR-3DLIGHT-COLOR: #fc9048;
SCROLLBAR-ARROW-COLOR: #fcfcfc;
SCROLLBAR-TRACK-COLOR: #fcfcfc;
SCROLLBAR-DARKSHADOW-COLOR: #fc9000;
SCROLLBAR-BASE-COLOR: #fcfcfc
}
</style>
<script>
//code by star 20003-4-7
var HC = "color:#990000;border:1px solid #cccccc";
var SC = "background-color:#efefef;border:1px solid #cccccc;color:#000000;";
var IO = null;
function initTree(){
var rootn = document.all.menuXML.documentElement;
var sd = 0;
document.onselectstart = function(){return false;}
document.all.treeBox.appendChild(createTree(rootn,sd));
}
function createTree(thisn,sd){
var nodeObj = document.createElement("span");
var upobj = document.createElement("span");
with(upobj){
style.marginLeft = sd*10;
className = thisn.hasChildNodes()?"hasItems":"Items";
innerHTML = "<img src=expand.gif class=ec>" + thisn.getAttribute("text") +"";
onmousedown = function(){
if(event.button != 1) return;
if(this.getAttribute("cn")){
this.setAttribute("open",!this.getAttribute("open"));
this.cn.style.display = this.getAttribute("open")?"inline":"none";
this.all.tags("img")[0].src = this.getAttribute("open")?"expand.gif":"contract.gif";
}
if(IO){
IO.runtimeStyle.cssText = "";
IO.setAttribute("selected",false);
}
IO = this;
this.setAttribute("selected",true);
this.runtimeStyle.cssText = SC;
}
onmouseover = function(){
if(this.getAttribute("selected"))return;
this.runtimeStyle.cssText = HC;
}
onmouseout = function(){
if(this.getAttribute("selected"))return;
this.runtimeStyle.cssText = "";
}
oncontextmenu = contextMenuHandle;
onclick = clickHandle;
}
if(thisn.getAttribute("treeId") != null){
upobj.setAttribute("treeId",thisn.getAttribute("treeId"));
}
if(thisn.getAttribute("href") != null){
upobj.setAttribute("href",thisn.getAttribute("href"));
}
if(thisn.getAttribute("target") != null){
upobj.setAttribute("target",thisn.getAttribute("target"));
}
nodeObj.appendChild(upobj);
nodeObj.insertAdjacentHTML("beforeEnd","<br>")
if(thisn.hasChildNodes()){
var i;
var nodes = thisn.childNodes;
var cn = document.createElement("span");
upobj.setAttribute("cn",cn);
if(thisn.getAttribute("open") != null){
upobj.setAttribute("open",(thisn.getAttribute("open")=="true"));
upobj.getAttribute("cn").style.display = upobj.getAttribute("open")?"inline":"none";
if( !upobj.getAttribute("open"))upobj.all.tags("img")[0].src ="contract.gif";
}
for(i=0;i<nodes.length;cn.appendChild(createTree(nodes[i++],sd+1)));
nodeObj.appendChild(cn);
}
else{
upobj.all.tags("img")[0].src ="endnode.gif";
}
return nodeObj;
}
window.onload = initTree;
</script>
<script>
function clickHandle(){
// your code here
}
function contextMenuHandle(){
event.returnValue = false;
var treeId = this.getAttribute("treeId");
// your code here
}
</script>
</HEAD>
<BODY>
<xml id=menuXML>
<?xml version="1.0" encoding="GB2312"?>
<DSTreeRoot text="体育新课程标准" open="true" href="http://" treeId="123">
<DSTree text="第一篇" open="false" treeId="">
<DSTree text="第一章" open="false" href="http://" target="box" treeId="12">
<DSTree text="第一节" href="http://" target="frmright" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="第二章" open="false" href="http://" target="box" treeId="213">
<DSTree text="第一节" href="http://" target="box" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="第三章" open="false" href="http://" target="box" treeId="432">
<DSTree text="第一节" href="http://" target="box" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
</DSTree>
</DSTree>
<DSTree text="第二篇" open="false" treeId="">
<DSTree text="第一章" open="false" href="http://" target="box" treeId="12">
<DSTree text="第一节" href="http://" target="box" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="第二章" open="false" href="http://" target="box" treeId="213">
<DSTree text="第一节" href="http://" target="box" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="第三章" open="false" href="http://" target="box" treeId="432">
<DSTree text="第一节" href="http://" target="box" treeId="4353" />
<DSTree text="第一节" href="http://" target="box" treeId="543543" />
<DSTree text="第一节" href="" target="box" treeId="2312" />
<DSTree text="第一节" href="" target="box" treeId="2312" />
</DSTree>
</DSTree>
</DSTreeRoot>
</xml>
<table style="position:absolute;left:1px;top:17px;" width="208">
<tr><td id=treeBox style="width:194px;height:200px;border:1px padding-left:5; padding-right:3; padding-top:5; padding-bottom:3" valign=top></td></tr>
<tr><td style="font:10px verdana;color:#999999" align=right> </td></tr>
</table>
</BODY>
</HTML>
作者: fenga6 发布时间: 2007-04-09
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28