精美的天气小偷代码

2008-02-23 07:50:44来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

可以根据用户的IP直接显示当地3天内的天气情况,纯静态非常小巧,可以直接插入任何网页.

下载: http://bbs.chinaz.com/UploadFile/2005-8/200581113211254275.rar

其实就是一段代码,保存为HTML文件weather.htm即可。
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>天气预报</title>
<style type="text/css">
<!--
{
margin: 0px;
}
.f14b {
font-size: 12px;
font-weight: bold;
color: #333333;
}
.f12orange {
font-size: 12px;
color: #ff6600;
}
.f2blue {
font-size: 12px;
color: #333333;
}
.f12blue2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #0066cc;
}
.f12red {
font-size: 12px;
color: #ff6600;
font-family: Arial, Helvetica, sans-serif;
}
.f2black {
font-size: 12px;
color: #000000;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
var openW;

function openWindow(theURL,winName,features) { //v2.0
//openW=window.open(theURL,winName,features);
//var mxh2 = window.open("about:blank","window_mxh")
//var mxh2 =window.open(theURL,winName,features);
window.showModalDialog(theURL,test(),'dialogHeight:270px;dialogWidth:265px;scroll:no;status:no')
}
function test(){
location.href="index.htm";

}
//-->
</script>

<script language="javascript" id="objscript"></script>
<script language="JavaScript" type="text/JavaScript" src="http://www.116.com.cn/116/home/weather/public.js"></script>
<script language="JavaScript" type="text/JavaScript" src="http://www.116.com.cn/116/home/weather/weather.js"></script>
<script language="JavaScript" type="text/JavaScript" src="http://jsp.116.com.cn/notice/iptocityid.jsp"></script>
<script language="JavaScript">


var locid;
var cityname;
var defid;

if(getCookie("defid")=='')
{
locid=CityID;


setCookie("defid",CityID);

}else
{
locid=getCookie("defid");

}
var havecheck;
if(getCookie("check")==''){
havecheck='2';
}else{
havecheck=getCookie("check");
}
var show;
if(havecheck=='0'){
locid=getCookie("CityID");

show=0;
}else {
locid=getCookie("defid");

show=1;
}

var urlstr = "http://jsp.116.com.cn/weather/" locid ".js";

document.all["objscript"].src = urlstr;
//var oWea = new makeWeatherObj();

</script>

<body topmargin="0" leftmargin="0">
<SCRIPT language="javascript">
var oWea = new makeWeatherObj();
</script>
<div align="center">
<table width="195" height="85" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="195" valign="bottom" class="f14b"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="10"></td>
</tr>
<tr>
<td align="center" class="f14b">您所在的城市:<font color="#ff6600">
<SCRIPT language="javascript">
document.write(oWea.swName);
</script></font>
</td>
</tr>
<tr>
<td height="10"></td>
</tr>
</table></td>
</tr>
<tr>
<form name="form1" method="post" action="">
<td width="160" align="center" valign="top">
<table width="190" border="0" cellspacing="0" cellpadding="0">
<tr align="center" valign="bottom">
<td width="60" height="15" class="f12orange">今天</td>
<td width="60" class="f2blue">明天</td>
<td width="60" class="f2blue">后天</td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr align="center">
<td height="25"><SCRIPT language="javascript">
var weather24=oWea.swWeather24.split("-");
document.write("<img src=http://www.116.com.cn/116/home/weather/images/icons/" transTab(weather24[0]) "_small.gif border='0'>");
if(weather24.length==2) document.write("<img src=http://www.116.com.cn/116/home/weather/images/icons/" transTab(weather24[1]) "_small.gif border='0'>");

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:几种设为首页的代码

下一篇:实现彩色闪烁超链接效果的JS代码