【www.gdgbn.com--python】

xml文件




2008年4月29日
胡志明市
http://down.111cn.net/cn/journey/hochiminhcity/


2008年4月30日
香港
http://www.111cn.net/cn/journey/hongkong/

js文件

<script language="网页特效" type="text/javascript">
var xmldoc;
function showcurcity()
{
if(window.activexobject)
{
xmldoc=new activexobject("microsoft.xmldom");
xmldoc.async="false"
xmldoc.load("olycity.xml");
getvalue();
}
else if(document.implementation && document.implementation.createdocument)
{
xmldoc=document.implementation.createdocument("", "root", null);
xmldoc.load("olycity.xml");
xmldoc.onload=getvalueff;
}
else
{
return null;
}
}
function getvalue()
{
var nodes=xmldoc.documentelement.childnodes;
var now=new date();
for(i=0;i var value=nodes.item(i).childnodes.item(0).text ;
if(value==now.tolocaledatestring())
{
window.document.getelementbyid("curcity").innertext=nodes.item(i).childnodes.item(1).text;
window.document.getelementbyid("curcity").href =nodes.item(i).childnodes.item(2).text;
}
}
}
function getvalueff(){
var ccode=xmldoc.getelementsbytagname("date");
var now = new date();
var nowvalue=now.getfullyear()+"年"+(now.getmonth()+1)+"月"+now.getdate()+"日";
for(i=0;i {
var value=ccode[i].childnodes[0].nodevalue;
if(value==nowvalue)
{
window.document.getelementbyid("curcity").href =xmldoc.getelementsbytagname("url")[i].childnodes[0].nodevalue;;
window.document.getelementbyid("curcity").childnodes[0].nodevalue=xmldoc.getelementsbytagname("city")[i].childnodes[0].nodevalue;
}
}
}
setinterval(showcurcity,1000);
</script>

本文来源:http://www.gdgbn.com/jiaocheng/27544/