奥运奖牌榜代码
- 作者:netecflash 来源:蓝色理想 文章点击数:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache,must-revalidate" />
<meta http-equiv="expires" content="0" />
<title>2008北京奥运奖牌榜Top5</title>
<style type="text/css">
<!--
body{margin:0px;}
.zy {
font-size: 12px;
color: #2e2e2e;
text-decoration: none;
line-height: 22px;
}
.zy a {
font-size: 12px;
color: #2e2e2e;
text-decoration: none;
line-height: 22px;
}
.zy a:hover {
font-size: 12px;
color: #2e2e2e;
text-decoration: underline;
line-height: 22px;
}
-->
</style>
</head>
<script type="text/javascript">
<!--
var queryUrl="http://2008.sina.com.cn/live/js/country_medal.js";
function loadscript(url,callback,charset){var script=document.createElement("script"); script.setAttribute('type','text/javascript');if(charset){script.setAttribute("charset",charset);}script.setAttribute('src',url);if(document.all){script.onreadystatechange=function(){if((/(complete|loaded)/).test(this.readyState)){if(typeof(callback)=="function"){callback();}remove(url);}};}else{script.onload=function(){if(typeof(callback)=="function"){callback();}remove(url);};}function remove(url){var scripts=document.getElementsByTagName("script");for(var i=scripts.length-1;i>-1;i--){if(scripts[i].getAttribute("src").toLowerCase()==url.toLowerCase()){scripts[i].parentNode.removeChild(scripts[i]);break;}}};document.getElementsByTagName("head")[0].appendChild(script);}
var running=null;
function OlympicGame()
{
loadscript(queryUrl,null,"gb2312");
if(running==null)
{
running=setInterval("OlympicGame()",180000);
}
}
function medal_rank()
{
var OlympicTopArr=[],contry=country_medal.split("$");
for(var i=0;i<contry.length;i++)
{
var single=contry[i].split("~");
if(single.length==6)
{
OlympicTopArr.push({
"Rank":single[2],
"link":"http://2008.sina.com.cn/noc/"+single[1].toLowerCase()+"/index.html",
"Delegation":single[0],
"Gold":single[3],
"Silver":single[4],
"Bronze":single[5],
"Jpg":"/Upfiles/BeyondPic/2008-08/20088143896287383.gif"
});
}
}
OlympicTopArr.sort(function(a,b){return a.Rank-b.Rank;});
var OlympicMsg="<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"cde9fe\" class=\"zy\">",divObj=document.getElementById("OlympicBoard");
for(var i=0;i<OlympicTopArr.length;i++)
{
OlympicMsg+="<tr><td width=\"28\" bgcolor=\"#ffffff\" align = \"center\">";
OlympicMsg+=OlympicTopArr[i].Rank;
OlympicMsg+=".</td><td width=\"50\" bgcolor=\"#ffffff\"><img src=\"";
OlympicMsg+=OlympicTopArr[i].Jpg;
OlympicMsg+="\" alt=\"";
OlympicMsg+=OlympicTopArr[i].Delegation;
OlympicMsg+="\" style=\"width:20px\" /></td><td bgcolor=\"#ffffff\"><a href=\"";
OlympicMsg+=OlympicTopArr[i].link;
OlympicMsg+="\" target=\"_blank\">";
OlympicMsg+=OlympicTopArr[i].Delegation;
OlympicMsg+="</a></td><td width=\"28\" bgcolor=\"#ffffff\" align = \"center\">";
OlympicMsg+=OlympicTopArr[i].Gold;
OlympicMsg+="</td><td width=\"28\" bgcolor=\"#ffffff\" align = \"center\">";
OlympicMsg+=OlympicTopArr[i].Silver;
OlympicMsg+="</td><td width=\"28\" bgcolor=\"#ffffff\" align = \"center\">";
OlympicMsg+=OlympicTopArr[i].Bronze;
OlympicMsg+="</td></tr>";
}
OlympicMsg+="</table>";
if(!divObj)
{
divObj=document.createElement("div");
divObj.setAttribute("id","OlympicBoard");
document.body.appendChild(divObj);
}
divObj.innerHTML=OlympicMsg;
var datetime=new Date().toLocaleString();
datetime="于 "+datetime+" 更新";
document.getElementById("tip").innerHTML="数据每隔3分钟更新一次,上次"+datetime;
}
window.onload=function()
{
document.getElementById("OlympicBoard").innerHTML="<center class=\"zy\">正在更新数据...</center>";
OlympicGame();
}
//-->
</script>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#eef8ff" class="zy" >
<tr>
<td width="28" align = "center">名次</td>
<td colspan="2" align = "center">国家地区</td>
<td width="28" align = "center">金</td>
<td width="28" align = "center">银</td>
<td width="28" align = "center">铜</td>
</tr>
</table>
<div id="OlympicBoard"></div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="zy">
<tr>
<td height="20" id="tip">数据每隔3分钟更新一次</td>
<td width="100" align="right"><a href="javascript:void(0)" onclick="OlympicGame()">手动更新数据</a></td>
</tr>
</table>
</body>
</html>

- 相关文章
| ·半完美模拟滚动条simScroll... | 08-13 |
| ·最新北京奥运官方网站幻灯片切换效果 | 08-12 |
| ·js文字滚动效果 | 08-11 |
| ·很酷实用的右键弹出菜单 | 08-11 |
| ·一个简单的相册效果,简单但兼容性好 | 08-02 |
| ·一个图片展示效果 | 08-01 |
| ·一个弹出窗口的小效果 | 08-01 |
| ·功能强大,代码简单的管理菜单 | 07-26 |
