调用腾讯网站的天气预报

以下是调用腾讯网站天气预告的代码,引用脚本在下面的附件中!

<!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" />
<title>天气</title>
</head>

<body>
<style type="text/css">
#Wealth{line-height:18px;height:66px;padding-bottom:10px; float:left; cursor:pointer;width:207px; background:url(../images/info_18.gif) no-repeat 0px 5px;}
 #Wealth *{line-height:18px;}
 #Wealth h6{font-size:12px; margin:0 auto; padding-top:10px;}
 #Wealth span.img{float:left;display:block;padding-top:8px}
 #Wealth p{float:left;margin:0;padding:0; height:0px;}
 #Wealth div{font-size:12px;width:100px;}
</style>
<script language="javascript">
function loadPng(o){
 if(MiniSite.Browser.ie){
  try{
   var img = o;
   var imgName = o.src.toUpperCase();
   if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
    var imgID = (img.id) ? "id='" + img.id + "' " : "";
    var imgClass = (img.className) ? "class='" + img.className + "' " : "";
    var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
    var imgStyle = "display:inline-block;" + img.style.cssText;
    if (img.align == "left") imgStyle = "float:left;" + imgStyle;
    if (img.align == "right") imgStyle = "float:right;" + imgStyle;
    if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle ;
    var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='image');\"></span>";
    img.outerHTML = strNewHTML;   
   }
  }catch (e){}
 }
}
</script>
<script type="text/javascript" src="j.soso.weather_utf8.js"></script>
</head>
<body>
<div id="Wealth"></div>
<script type="text/javascript">
/*<![CDATA[*/
MiniSite.Weather.print("Wealth");
/*]]>*/
</script>
</body>
</html>

 点击下载此文件



文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: 腾讯 天气预报 代码
相关日志:
评论: 1 | 引用: 0 | 查看次数: -
回复回复刷刷[2010-03-05 11:39 AM | del]
兄弟  终于找到一个完善的UTF-8的JS天气了
但还是想麻烦兄弟一下的是
能不能帮我把那个天气的图标去了
鼠标放上去的连接也去了
我只想要文字。
比如:  北京  晴   2-12度
可以帮忙么
如果改好了发我邮箱好么?
regal2002@163.com

先谢谢了!
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.