<div class="newsItem"> <script language="javascript" type="text/javascript">
<!--
var dayarray=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六")
var montharray=new Array("01","02","03","04","05","06","07","08","09","10","11","12")
function getthedate()
{
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn=""
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var cdate=" "+year+"年"+montharray[month]+"月"+daym+"日"+" "+dayarray[day]+" "+dn+" "+hours+":"+minutes+":"+seconds
if (document.all)
document.all.clock.innerHTML=cdate
else
document.write(cdate)
}
if (!document.all)
getthedate()
function goforit()
{
if (document.all)
setInterval("getthedate()",1000)
}
goforit();
//document.write("<span id=clock></span>");
-->
</script>
<br><span id="clock" name="clock"></span><iframe
border="0" frameborder="no" height="54" marginheight="0" marginwidth="0" scrolling="no" allowTransparency="true" src="http://weather.265.com/weather.htm" width="200">
</iframe>
转自:http://hi.baidu.com/ryan_dream/blog/item/daaa3c5099937a648535248f.html
2008-09-22 13:42转:天气预报接口2008-02-25 11:01(1)这是你想要的天气预报代码,由中央气象台提供数据,最准确最权威的天气预报,能够根据访客不同的IP地址显示不同城市的天气预报
下面是源程序代码:
<iframe src="http://www.ttyyy.com/tianqi/tq.html" width="160" height="60" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
(3)名称:新浪天气预报代码
代码 :<IFRAME ID='ifm2' WIDTH='260' HEIGHT='70' ALIGN='CENTER' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='0' VSPACE='0' FRAMEBORDER='0' SCROLLING='NO' src="http://news.sina.com.cn/iframe/weather/130101.html"></iframe>
说明 :这种适合于在网页的头栏插入。上面的城市可以自定,比如 石家庄可改成别的。
城市代码:
"110100","北京"
"120100","天津"
"130101","石家庄"
"130201","唐山"
"130301","秦皇岛"
"130701","张家口"
"130801","承德"
"131001","廊坊"
"130401","邯郸"
"130501","邢台"
"130601","保定"
"130901","沧州"
"133001","衡水"
"140101","太原"
"140201","大同"
"140301","阳泉"
"140501","晋城"
"140601","朔州"
"142201","忻州"
"142331","离石"
"142401","榆次"
"142601","临汾"
"142701","运城"
"140401","长治"
"150101","呼和浩特"
"150201","包头"
"150301","乌海"
"152601","集宁"
"152701","巴彦浩特"
"152801","临河"
"152921","鄂尔多斯"
"150401","赤峰"
"152301","通辽"
"152502","锡林浩特"
"152101","海拉尔"
"152201","乌兰浩特"
"210101","沈阳"
"210201","大连"
"210301","鞍山"
"210401","抚顺"
"210501","本溪"
"210701","锦州"
"210801","营口"
"210901","阜新"
"211101","盘锦"
"211201","铁岭"
"211301","朝阳"
"211401","葫芦岛"
"210601","丹东"
"220101","长春"
"220201","吉林"
"220301","四平"
"220401","辽源"
"220601","松原"
"222301","白城"
"222401","延边"
"220501","通化"
"230101","哈尔滨"
"230301","鸡西"
"230401","鹤岗"
"230501","双鸭山"
"230701","伊春"
"230801","佳木斯"
"230901","七台河"
"231001","牡丹江"
"232301","绥化"
"230201","齐齐哈尔"
"230601","大庆"
"232601","黑河"
"232700","大兴安岭"
"310100","上海"
"320101","南京"
"320201","无锡"
"320301","徐州"
"320401","常州"
"320501","苏州"
"320600","南通"
"320701","连云港"
"320801","淮阴"
"320901","盐城"
"321001","扬州"
"321101","镇江"
"321102","泰州"
"321103","宿迁"
"330101","杭州"
"330201","宁波"
"330301","温州"
"330401","嘉兴"
"330501","湖州"
"330601","绍兴"
"330701","金华"
"330801","衢州"
"330901","舟山"
"332501","丽水"
"332602","台州"
"340101","合肥"
"340201","芜湖"
"340301","蚌埠"
"340401","淮南"
"340501","马鞍山"
"340601","淮北"
"340701","铜陵"
"340801","安庆"
"341001","黄山市"
"342101","阜阳"
"342201","宿州"
"342301","滁州"
"342401","六安"
"342501","宣城"
"342601","巢湖"
"342901","池州"
"350101","福州"
"350201","厦门"
"350301","莆田"
"350401","三明"
"350501","泉州"
"350601","漳州"
"352101","南平"
"352201","宁德"
"352601","龙岩"
"352602","陇南"
"352603","庆阳"
"360101","南昌"
"360201","景德镇"
"362101","赣州"
"360301","萍乡"
"360401","九江"
"360501","新余"
"360601","鹰潭"
"362201","宜春"
"362301","上饶"
"362401","吉安"
"370101","济南"
"370201","青岛"
"370301","淄博"
"370401","枣庄"
"370501","东营"
"370601","烟台"
"370701","潍坊"
"370801","济宁"
"370901","泰安"
"371001","威海"
"371100","日照"
"372301","滨州"
"372401","德州"
"372501","聊城"
"372801","临沂"
"372901","菏泽"
"372902","莱芜"
"410101","郑州"
"410201","开封"
"410301","洛阳"
"410401","平顶山"
"410501","安阳"
"410601","鹤壁"
"410701","新乡"
"410801","焦作"
"410901","濮阳"
"411001","许昌"
"411101","漯河"
"411201","三门峡"
"412301","商丘"
"412701","周口"
"412801","驻马店"
"412901","南阳"
"413001","信阳"
"420101","武汉"
"420201","黄石"
"420301","十堰"
"420400","随州"
"420501","宜昌"
"420601","襄樊"
"420701","鄂州"
"420801","荆门"
"422103","黄冈"
"422201","孝感"
"422301","咸宁"
"422421","荆州"
"422801","恩施"
"430101","长沙"
"430401","衡阳"
"430501","邵阳"
"432801","郴州"
"432901","永州"
"430801","韶山"
"430802","张家界"
"433001","怀化"
"433101","吉首"
"430201","株洲"
"430301","湘潭"
"430601","岳阳"
"430701","常德"
"432301","益阳"
"432501","娄底"
"440101","广州"
"440301","深圳"
"441501","汕尾"
"441301","惠州"
"441601","河源"
"441801","清远"
"441901","东莞"
"440401","珠海"
"440701","江门"
"441201","肇庆"
"442001","中山"
"440801","湛江"
"440901","茂名"
"440201","韶关"
"440501","汕头"
"441401","梅州"
"441701","阳江"
"441702","潮州"
"441703","顺德"
"441704","揭阳"
"441705","云浮"
"450101","南宁"
"450401","梧州"
"452501","玉林"
"450301","桂林"
"452601","百色"
"452701","河池"
"452802","钦州"
"450201","柳州"
"450501","北海"
"450502","防城港"
"450503","贵港"
"450504","贺州"
"460100","海口"
"460200","三亚"
"460300","西沙群岛"
"510101","成都"
"513321","眉山"
"513101","雅安"
"513229","峨嵋山"
"510301","自贡"
"500100","重庆"
"500102","万州"
"500103","涪陵"
"512901","南充"
"510501","泸州"
"510601","德阳"
"510701","绵阳"
"510901","遂宁"
"511001","内江"
"511101","乐山"
"512501","宜宾"
"510801","广元"
"513021","达州"
"513401","资阳"
"510401","攀枝花"
"510402","阿坝"
"510403","甘孜"
"510404","凉山"
"510405","广安"
"510406","巴中"
"500239","黔江"
"520101","贵阳"
"520200","六盘水"
"522201","铜仁"
"522501","安顺"
"522601","凯里"
"522701","都匀"
"522301","兴义"
"522421","毕节"
"522101","遵义"
"530101","昆明"
"530201","德宏"
"532201","曲靖"
"532301","楚雄"
"532401","玉溪"
"532501","红河"
"532621","文山"
"532721","思茅"
"532101","昭通"
"532821","西双版纳"
"532901","大理"
"533001","保山"
"533121","怒江"
"533221","丽江"
"533321","迪庆"
"533521","临沧"
"540101","拉萨"
"542121","昌都"
"542221","山南"
"542301","日喀则"
"542421","那曲"
"542523","阿里"
"542621","林芝"
"610101","西安"
"610201","铜川"
"610301","宝鸡"
"610401","咸阳"
"612101","渭南"
"612301","汉中"
"612401","安康"
"612501","商洛"
"612601","延安"
"612701","榆林"
"620101","兰州"
"620401","白银"
"620301","金昌"
"620501","天水"
"622201","张掖"
"622301","武威"
"622421","定西"
"622701","平凉"
"622901","临夏"
"620201","嘉峪关"
"622102","酒泉"
"630100","西宁"
"632121","果洛"
"632221","海西"
"632321","格尔木"
"632521","海东"
"632621","海北"
"632721","玉树"
"632802","黄南"
"640101","银川"
"640201","石嘴山"
"642101","吴忠"
"642221","固原"
"650101","乌鲁木齐"
"650201","克拉玛依"
"652101","吐鲁番"
"652201","哈密"
"652301","昌吉"
"652701","博乐"
"652801","库尔勒"
"652901","阿克苏"
"653001","克州"
"653101","喀什"
"654101","伊犁"
"655001","石河子"
"655002","塔城"
"655003","阿勒泰"
"710001","台北"
"211001","辽阳"
"653201","和田"
"820000","澳门"
"810000","香港"
第一种:
代码: 效果预览:
<iframe width="145" height="130" border="0" align="center" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="http://minisite.qq.com/Weather/news_new.html" allowTransparency="true"></iframe>
说明:这种适合于在网页的边栏插入。但一个缺点是,上面的4个城市是既定的,无法改成别的。插入时,选好网页上的位置,直接将左栏的源代码全部拷进去就行了
第二种:
代码: 效果预览:
<IFRAME ID='ifm2' WIDTH='189' HEIGHT='190' ALIGN='CENTER' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='0' VSPACE='0' FRAMEBORDER='0' SCROLLING='NO' SRC='http://weather.qq.com/inc/ss258.htm'></IFRAME>
说明:这种 也适合于在网页的边栏插入。上面的城市可以自定,比如厦门可改成别的。定制的方法是修改我代码中标红的数字,从1开始代表“香港”开始,每个数字都代表一个城市,厦门是287,具体要哪个城市自己找一下罢。
第三种:
代码: 效果预览:
<IFRAME ID='ifm2' WIDTH='260' HEIGHT='70' ALIGN='CENTER' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='0' VSPACE='0' FRAMEBORDER='0' SCROLLING='NO' src="http://news.sina.com.cn/iframe/weather/130101.html"></iframe>
说明:这种适合于在网页的头栏插入。上面的城市可以自定,比如 石家庄可改成别的。定制的方法是修改我代码中标红的数字。具体各个城市对照的id表可在此下载:城市名称及ID对照表(请右键点击—>另存为)。
第四种:
代码: 效果预览:
<iframe width="469" height="218" border="0" align="center" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="http://appnews.qq.com/cgi-bin/news_weather_search?city=厦门" allowTransparency="true"></iframe>
说明:这种适合于在网页的正栏插入。上面的城市可以自定,比如厦门可改成别的。定制的方法是修改我代码中标红的 名称。这里比较简单,直接用汉字改就行了。比如是福州的,你就直接把“厦门”改成福州就行。
<> 第五种:
<> 代码: 效果预览:
<> <IFRAME ID='ifm1' WIDTH='405' HEIGHT='332' ALIGN='center' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='0' VSPACE='0' FRAMEBORDER='0' SCROLLING='NO' SRC="http://weather.qq.com/24.htm"></IFRAME>