JAVA—咖啡馆

——欢迎访问rogerfan的博客,常来《JAVA——咖啡馆》坐坐,喝杯浓香的咖啡,彼此探讨一下JAVA技术,交流工作经验,分享JAVA带来的快乐!本网站部分转载文章,如果有版权问题请与我联系。

BlogJava 首页 新随笔 联系 聚合 管理
  447 Posts :: 145 Stories :: 368 Comments :: 0 Trackbacks
<script language="JavaScript" type="text/javascript">
//鼠标经过时候显示div    
function showdiv(content,field) {

var x = window.event.x;
var y = window.event.y;
var show = document.getElementById("ShowInfo");
show.style.visibility 
= "visible";
show.style.top 
= y;
show.style.left 
= x;
show.style.background
="#ffff00";
//show.innerHTML = "1234567";
//
鼠标移动时候div跟随
XmlRead(content,field);
document.onmousemove 
= moveToMouseLoc;

}

//鼠标移开的时候隐藏div
function Remove()
{
        
var show=document.getElementById("ShowInfo");
        
if(show != "" || show != null)
        
{
            show.style.visibility 
= "hidden";
        }
    
}

//鼠标移动时候div跟随
function moveToMouseLoc(e)
{
    x 
= window.event.x;
    y 
= window.event.y;
  
var show = document.getElementById("ShowInfo");
  show.style.left 
= x;
  show.style.top 
= y;
  
return true;
}


//读取xml
function XmlRead(content,field)
{
    
var doc = new ActiveXObject("Microsoft.XMLDOM");
    
//得到隐藏控件中的xml值
    var sXml = document.getElementById("LbHidden").innerHTML;
    
try
    
{    
       doc.loadXML(sXml);
    }


    
catch(e)
    
{
       alert(e.message);
       
return ;
    }

    
//画一个table吧值存到table中
    var table = "<table cellspacing="0" rules="all" bordercolorlight="#b4b1b1" bordercolordark="#ffffff" border="1"><tr class='title'><td>数据来源</td><td>" + content + "</td></tr>";
    
var xmlnode = doc.documentElement;
    
for(i=0;i<xmlnode.childNodes.length;i++)
    

        
//加载xml值到table中  
        table += "<tr><td>" + xmlnode.childNodes.item(i).getAttribute('Desc');
        table 
+= "</td><td>" + xmlnode.childNodes.item(i).selectSingleNode("DATA/" + field.toUpperCase()).text + "</td></tr>";
        
//alert(xmlnode.childNodes.item(i).getAttribute('成考'));
    }

    table 
+= "</table>";
   
//把table放到div中的span中
    document.getElementById('sp').innerHTML=table;      
    
//nod=doc.selectSingleNode("Datas/Source[@Desc='成考']/Data/WaterOutCount/");
    //nod=doc.selectSingleNode("Datas/Source")
    //nod.text;
}


</script>    
<Source Desc="成考" type="1"><Data><EnterCode>440116191159320</EnterCode><Year>2007</Year><DataType>11</DataType><Month>11</Month><Day>11</Day><WaterOutCount>11</WaterOutCount><WaterOut>11</WaterOut><Water_UpOut>11</Water_UpOut><Water_OverOut>11</Water_OverOut><Water_ToSeaOut>11</Water_ToSeaOut><Water_ToRiverOut>11</Water_ToRiverOut><Water_ToSewerOut>11</Water_ToSewerOut><Water_ToSewageFarmOut>11</Water_ToSewageFarmOut><Water_ToOtherOut>11</Water_ToOtherOut><Water_ToOtherAirOut>11</Water_ToOtherAirOut><Water_ToOtherOtherOut>11</Water_ToOtherOtherOut><Water_ToOtherFarmOut>11</Water_ToOtherFarmOut><Water_ToOtherEnterOut>11</Water_ToOtherEnterOut><Water_ToOtherWFarmOut>11</Water_ToOtherWFarmOut><DataSource>11</DataSource><EnterIndustryId>11</EnterIndustryId><WaterProduce>11</WaterProduce><IndustryWaterOut>11</IndustryWaterOut><LifeWaterOut>11</LifeWaterOut><Code_OutType>11</Code_OutType><sum1>11111111</sum1><sum2>11111111</sum2></Data></Source><Source Desc="焦点" type="2"><Data><EnterCode>440116191159320</EnterCode><Year>2007</Year><DataType>11</DataType><Month>22</Month><Day>22</Day><WaterOutCount>22</WaterOutCount><WaterOut>22</WaterOut><Water_UpOut>22</Water_UpOut><Water_OverOut>22</Water_OverOut><Water_ToSeaOut>22</Water_ToSeaOut><Water_ToRiverOut>22</Water_ToRiverOut><Water_ToSewerOut>22</Water_ToSewerOut><Water_ToSewageFarmOut>22</Water_ToSewageFarmOut><Water_ToOtherOut>22</Water_ToOtherOut><Water_ToOtherAirOut>22</Water_ToOtherAirOut><Water_ToOtherOtherOut>22</Water_ToOtherOtherOut><Water_ToOtherFarmOut>22</Water_ToOtherFarmOut><Water_ToOtherEnterOut>22</Water_ToOtherEnterOut><Water_ToOtherWFarmOut>22</Water_ToOtherWFarmOut><DataSource>22</DataSource><EnterIndustryId>22</EnterIndustryId><WaterProduce>22</WaterProduce><IndustryWaterOut>22</IndustryWaterOut><LifeWaterOut>22</LifeWaterOut><Code_OutType>22</Code_OutType><sum1>22222222</sum1><sum2>22222222</sum2></Data></Source>
posted on 2008-03-04 16:31 rogerfan 阅读(819) 评论(0)  编辑  收藏 所属分类: 【JS/HTML】

只有注册用户登录后才能发表评论。


网站导航: