好主机建站-建站不再是梦想

立即注册开通网站

 

售前咨询QQ:599166136
登录官方论坛:http://bbs.letgo.com.cn/
加入建站技术交流群: 广州维派建站交流①

精美的天气小偷代码

可以根据用户的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'>");
                                </script></td>
          <td><SCRIPT language="javascript">
                                var weather48=oWea.swWeather48.split("-");
                                document.write("<img src=http://www.116.com.cn/116/home/weather/images/icons/"+transTab(weather48[0])+"_small.gif border='0'>");
                                if(weather48.length==2) document.write("<img src=http://www.116.com.cn/116/home/weather/images/icons/"+transTab(weather48[1])+"_small.gif border='0'>");
                                </script></td>
          <td><SCRIPT language="javascript">
                                var weather72=oWea.swWeather72.split("-");
                                document.write("<img src=http://www.116.com.cn/116/home/weather/images/icons/"+transTab(weather72[0])+"_small.gif border='0'>");
                                if(weather72.length==2) document.write("<img src=http://www.116.com.cn/116/home/weather/images/icons/"+transTab(weather72[1])+"_small.gif  border='0'>");
                                </script></td>
        </tr>
        <tr align="center">
          <td><SCRIPT language="javascript">
                                     var wendu=oWea.swWendu24.split("-");
                                   document.write("<span class='f12blue2'>"+wendu[0]+"</span>");
            </script></td>
          <td height="20"><SCRIPT language="javascript">
                                     var wendu=oWea.swWendu48.split("-");
                                   document.write("<span class='f12blue2'>"+wendu[0]+"</span>");
            </script></td>
          <td height="20"><SCRIPT language="javascript">
                                     var wendu=oWea.swWendu72.split("-");
                                   document.write("<span class='f12blue2'>"+wendu[0]+"</span>");
            </script>
          </td>
        </tr>
      </table></td>
        </form>
  </tr>
</table></div>

页面调用代码:
<iframe frameborder=0 width=160 height=100 marginheight=0 marginwidth=0 name=weather scrolling=no title="天气预报" src="/weather.htm"></iframe>

 
[文章评论(0)] [ 点击数:] [打印本网页] [关闭本窗口]  

关注广州维派 你建网站,我来埋单!

网络营销之路 我们与您相伴

 

相关内容
查无记录
 

 

 

注册用户须知

免 责 申 明

粤ICP备12022451号

 关于我们

 联系我们

 如何支付

广州维派网络科技有限公司

(即好主机建站)

LetGo.com.cn 版权所有

 维派互联 (域名)

 数据中心 (空间)

 维信通 (微营销)

 

2016最新微营销,维信通正式上线,老用户尊享优惠。

自助建站  智能建站  企业网站建设  永久免费做网站  易邻网

  网络114企业名录  申请友情链接  

企业网站建设

安全狗-arp防火墙/ddosf防火墙

好主机自助建站

维信通

维品生活

克隆网站

做网站

智能建站

智能网站

企业建站

  

网站管理