惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
Cloudbric
Cloudbric
Schneier on Security
Schneier on Security
V2EX - 技术
V2EX - 技术
N
News and Events Feed by Topic
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
W
WeLiveSecurity
博客园 - 司徒正美
Jina AI
Jina AI
S
Secure Thoughts
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园 - 三生石上(FineUI控件)
The Last Watchdog
The Last Watchdog
S
Security @ Cisco Blogs
S
SegmentFault 最新的问题
Attack and Defense Labs
Attack and Defense Labs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
SecWiki News
SecWiki News
Google DeepMind News
Google DeepMind News
T
Troy Hunt's Blog
H
Heimdal Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
N
News and Events Feed by Topic
雷峰网
雷峰网
Last Week in AI
Last Week in AI
IT之家
IT之家
Project Zero
Project Zero
O
OpenAI News
腾讯CDC
The Hacker News
The Hacker News
L
Lohrmann on Cybersecurity
T
Tenable Blog
博客园_首页
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
S
Schneier on Security
Scott Helme
Scott Helme
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
人人都是产品经理
人人都是产品经理
P
Privacy International News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - asdsd

js收藏 - asdsd - 博客园 ArrayList最佳使用建议 右下角弹出消息 用js限制用户输入字节个数 - asdsd - 博客园 数据岛与分页 滚动条的设置 SQL中CONVERT转化函数的用法 js实现自动全屏幕 - asdsd - 博客园 迅速返回页面顶部代码 - asdsd - 博客园 图示元素的clientTop、offsetTop、offsetHeight等属性 揭开正则表达式 javascript中获取radiobuttonlist选中值 开发时碰到的问题以及心得经验 经常用到的javaScript技术 一劳永逸 让你与IE弹出窗口彻底告别 随机排1-100数字 判断一个对象是否存在 用C#制作新闻阅读器(电脑报2005年3月14日 第10期) 遮挡的问题
新浪天气-模拟
asdsd · 2006-12-04 · via 博客园 - asdsd

  1<%@ Page language="c#" Codebehind="GetWther.aspx.cs" AutoEventWireup="false" Inherits="ajaxselect.Weather.GetWther" %>
  2<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  3<HTM
   
  4    <HEAD>
  5        <title>GetWther</title>
  6        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
  7        <meta name="CODE_LANGUAGE" Content="C#">
  8        <meta name="vs_defaultClientScript" content="JavaScript">
  9        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
 10        <script language="JavaScript">
 11<!--
 12var g_selProvince;
 13var g_selCity;
 14var Provinces=new Array(
 15new Array("110000","北京市"),
 16new Array("120000","天津市"),
 17new Array("500000","重庆市"),
 18new Array("130000","河北省"),
 19new Array("140000","山西省"),
 20new Array("150000","内蒙古自治区"),
 21new Array("210000","辽宁省"),
 22new Array("220000","吉林省"),
 23new Array("230000","黑龙江省"),
 24new Array("310000","上海市"),
 25new Array("320000","江苏省"),
 26new Array("330000","浙江省"),
 27new Array("340000","安徽省"),
 28new Array("350000","福建省"),
 29new Array("360000","江西省"),
 30new Array("370000","山东省"),
 31new Array("410000","河南省"),
 32new Array("420000","湖北省"),
 33new Array("430000","湖南省"),
 34new Array("440000","广东省"),
 35new Array("450000","广西壮族自治区"),
 36new Array("460000","海南省"),
 37new Array("510000","四川省"),
 38new Array("520000","贵州省"),
 39new Array("530000","云南省"),
 40new Array("540000","西藏自治区"),
 41new Array("610000","陕西省"),
 42new Array("620000","甘肃省"),
 43new Array("630000","青海省"),
 44new Array("640000","宁夏回族自治区"),
 45new Array("650000","新疆维吾尔自治区"),
 46new Array("710000","台湾省"),
 47new Array("810000","香港特别行政区"),
 48new Array("820000","澳门特别行政区")
 49);
 50
 51var Citys=new Array(
 52new Array("110100","北京"),
 53new Array("120100","天津"),
 54new Array("130101","石家庄"),
 55new Array("130201","唐山"),
 56new Array("130301","秦皇岛"),
 57new Array("130701","张家口"),
 58new Array("130801","承德"),
 59new Array("131001","廊坊"),
 60new Array("130401","邯郸"),
 61new Array("130501","邢台"),
 62new Array("130601","保定"),
 63new Array("130901","沧州"),
 64new Array("133001","衡水"),
 65new Array("140101","太原"),
 66new Array("140201","大同"),
 67new Array("140301","阳泉"),
 68new Array("140501","晋城"),
 69new Array("140601","朔州"),
 70new Array("142201","忻州"),
 71new Array("142331","离石"),
 72new Array("142401","榆次"),
 73new Array("142601","临汾"),
 74new Array("142701","运城"),
 75new Array("140401","长治"),
 76new Array("150101","呼和浩特"),
 77new Array("150201","包头"),
 78new Array("150301","乌海"),
 79new Array("152601","集宁"),
 80new Array("152701","巴彦浩特"),
 81new Array("152801","临河"),
 82new Array("152921","鄂尔多斯"),
 83new Array("150401","赤峰"),
 84new Array("152301","通辽"),
 85new Array("152502","锡林浩特"),
 86new Array("152101","海拉尔"),
 87new Array("152201","乌兰浩特"),
 88new Array("210101","沈阳"),
 89new Array("210201","大连"),
 90new Array("210301","鞍山"),
 91new Array("210401","抚顺"),
 92new Array("210501","本溪"),
 93new Array("210701","锦州"),
 94new Array("210801","营口"),
 95new Array("210901","阜新"),
 96new Array("211101","盘锦"),
 97new Array("211201","铁岭"),
 98new Array("211301","朝阳"),
 99new Array("211401","葫芦岛"),
100new Array("210601","丹东"),
101new Array("220101","长春"),
102new Array("220201","吉林"),
103new Array("220301","四平"),
104new Array("220401","辽源"),
105new Array("220601","松原"),
106new Array("222301","白城"),
107new Array("222401","延边"),
108new Array("220501","通化"),
109new Array("230101","哈尔滨"),
110new Array("230301","鸡西"),
111new Array("230401","鹤岗"),
112new Array("230501","双鸭山"),
113new Array("230701","伊春"),
114new Array("230801","佳木斯"),
115new Array("230901","七台河"),
116new Array("231001","牡丹江"),
117new Array("232301","绥化"),
118new Array("230201","齐齐哈尔"),
119new Array("230601","大庆"),
120new Array("232601","黑河"),
121new Array("232700","大兴安岭"),
122new Array("310100","上海"),
123new Array("320101","南京"),
124new Array("320201","无锡"),
125new Array("320301","徐州"),
126new Array("320401","常州"),
127new Array("320501","苏州"),
128new Array("320600","南通"),
129new Array("320701","连云港"),
130new Array("320801","淮阴"),
131new Array("320901","盐城"),
132new Array("321001","扬州"),
133new Array("321101","镇江"),
134new Array("321102","泰州"),
135new Array("321103","宿迁"),
136new Array("330101","杭州"),
137new Array("330201","宁波"),
138new Array("330301","温州"),
139new Array("330401","嘉兴"),
140new Array("330501","湖州"),
141new Array("330601","绍兴"),
142new Array("330701","金华"),
143new Array("330801","衢州"),
144new Array("330901","舟山"),
145new Array("332501","丽水"),
146new Array("332602","台州"),
147new Array("340101","合肥"),
148new Array("340201","芜湖"),
149new Array("340301","蚌埠"),
150new Array("340401","淮南"),
151new Array("340501","马鞍山"),
152new Array("340601","淮北"),
153new Array("340701","铜陵"),
154new Array("340801","安庆"),
155new Array("341001","黄山市"),
156new Array("342101","阜阳"),
157new Array("342201","宿州"),
158new Array("342301","滁州"),
159new Array("342401","六安"),
160new Array("342501","宣城"),
161new Array("342601","巢湖"),
162new Array("342901","池州"),
163new Array("350101","福州"),
164new Array("350201","厦门"),
165new Array("350301","莆田"),
166new Array("350401","三明"),
167new Array("350501","泉州"),
168new Array("350601","漳州"),
169new Array("352101","南平"),
170new Array("352201","宁德"),
171new Array("352601","龙岩"),
172new Array("622602","陇南"),
173new Array("622603","庆阳"),
174new Array("360101","南昌"),
175new Array("360201","景德镇"),
176new Array("362101","赣州"),
177new Array("360301","萍乡"),
178new Array("360401","九江"),
179new Array("360501","新余"),
180new Array("360601","鹰潭"),
181new Array("362201","宜春"),
182new Array("362301","上饶"),
183new Array("362401","吉安"),
184new Array("370101","济南"),
185new Array("370201","青岛"),
186new Array("370301","淄博"),
187new Array("370401","枣庄"),
188new Array("370501","东营"),
189new Array("370601","烟台"),
190new Array("370701","潍坊"),
191new Array("370801","济宁"),
192new Array("370901","泰安"),
193new Array("371001","威海"),
194new Array("371100","日照"),
195new Array("372301","滨州"),
196new Array("372401","德州"),
197new Array("372501","聊城"),
198new Array("372801","临沂"),
199new Array("372901","菏泽"),
200new Array("372902","莱芜"),
201new Array("410101","郑州"),
202new Array("410201","开封"),
203new Array("410301","洛阳"),
204new Array("410401","平顶山"),
205new Array("410501","安阳"),
206new Array("410601","鹤壁"),
207new Array("410701","新乡"),
208new Array("410801","焦作"),
209new Array("410901","濮阳"),
210new Array("411001","许昌"),
211new Array("411101","漯河"),
212new Array("411201","三门峡"),
213new Array("412301","商丘"),
214new Array("412701","周口"),
215new Array("412801","驻马店"),
216new Array("412901","南阳"),
217new Array("413001","信阳"),
218new Array("420101","武汉"),
219new Array("420201","黄石"),
220new Array("420301","十堰"),
221new Array("420400","随州"),
222new Array("420501","宜昌"),
223new Array("420601","襄樊"),
224new Array("420701","鄂州"),
225new Array("420801","荆门"),
226new Array("422103","黄冈"),
227new Array("422201","孝感"),
228new Array("422301","咸宁"),
229new Array("422421","荆州"),
230new Array("422801","恩施"),
231new Array("430101","长沙"),
232new Array("430401","衡阳"),
233new Array("430501","邵阳"),
234new Array("432801","郴州"),
235new Array("432901","永州"),
236new Array("430801","韶山"),
237new Array("430802","张家界"),
238new Array("433001","怀化"),
239new Array("433101","吉首"),
240new Array("430201","株洲"),
241new Array("430301","湘潭"),
242new Array("430601","岳阳"),
243new Array("430701","常德"),
244new Array("432301","益阳"),
245new Array("432501","娄底"),
246new Array("440101","广州"),
247new Array("440601","佛山"),
248new Array("440301","深圳"),
249new Array("441501","汕尾"),
250new Array("441301","惠州"),
251new Array("441601","河源"),
252new Array("441801","清远"),
253new Array("441901","东莞"),
254new Array("440401","珠海"),
255new Array("440701","江门"),
256new Array("441201","肇庆"),
257new Array("442001","中山"),
258new Array("440801","湛江"),
259new Array("440901","茂名"),
260new Array("440201","韶关"),
261new Array("440501","汕头"),
262new Array("441401","梅州"),
263new Array("441701","阳江"),
264new Array("441702","潮州"),
265new Array("441703","顺德"),
266new Array("441704","揭阳"),
267new Array("441705","云浮"),
268new Array("450101","南宁"),
269new Array("450401","梧州"),
270new Array("452501","玉林"),
271new Array("450301","桂林"),
272new Array("452601","百色"),
273new Array("452701","河池"),
274new Array("452802","钦州"),
275new Array("450201","柳州"),
276new Array("450501","北海"),
277new Array("450502","防城港"),
278new Array("450503","贵港"),
279new Array("450504","贺州"),
280new Array("460100","海口"),
281new Array("460200","三亚"),
282new Array("460300","西沙群岛"),
283new Array("510101","成都"),
284new Array("513321","眉山"),
285new Array("513101","雅安"),
286new Array("513229","峨嵋山"),
287new Array("510301","自贡"),
288new Array("500100","重庆"),
289new Array("500102","万州"),
290new Array("500103","涪陵"),
291new Array("512901","南充"),
292new Array("510501","泸州"),
293new Array("510601","德阳"),
294new Array("510701","绵阳"),
295new Array("510901","遂宁"),
296new Array("511001","内江"),
297new Array("511101","乐山"),
298new Array("512501","宜宾"),
299new Array("510801","广元"),
300new Array("513021","达州"),
301new Array("513401","资阳"),
302new Array("510401","攀枝花"),
303new Array("510402","阿坝"),
304new Array("510403","甘孜"),
305new Array("510404","凉山"),
306new Array("510405","广安"),
307new Array("510406","巴中"),
308new Array("500239","黔江"),
309new Array("520101","贵阳"),
310new Array("520200","六盘水"),
311new Array("522201","铜仁"),
312new Array("522501","安顺"),
313new Array("522601","凯里"),
314new Array("522701","都匀"),
315new Array("522301","兴义"),
316new Array("522421","毕节"),
317new Array("522101","遵义"),
318new Array("530101","昆明"),
319new Array("530201","德宏"),
320new Array("532201","曲靖"),
321new Array("532301","楚雄"),
322new Array("532401","玉溪"),
323new Array("532501","红河"),
324new Array("532621","文山"),
325new Array("532721","思茅"),
326new Array("532101","昭通"),
327new Array("532821","西双版纳"),
328new Array("532901","大理"),
329new Array("533001","保山"),
330new Array("533121","怒江"),
331new Array("533221","丽江"),
332new Array("533321","迪庆"),
333new Array("533521","临沧"),
334new Array("540101","拉萨"),
335new Array("542121","昌都"),
336new Array("542221","山南"),
337new Array("542301","日喀则"),
338new Array("542421","那曲"),
339new Array("542523","阿里"),
340new Array("542621","林芝"),
341new Array("610101","西安"),
342new Array("610201","铜川"),
343new Array("610301","宝鸡"),
344new Array("610401","咸阳"),
345new Array("612101","渭南"),
346new Array("612301","汉中"),
347new Array("612401","安康"),
348new Array("612501","商洛"),
349new Array("612601","延安"),
350new Array("612701","榆林"),
351new Array("620101","兰州"),
352new Array("620401","白银"),
353new Array("620301","金昌"),
354new Array("620501","天水"),
355new Array("622201","张掖"),
356new Array("622301","武威"),
357new Array("622421","定西"),
358new Array("622701","平凉"),
359new Array("622901","临夏"),
360new Array("620201","嘉峪关"),
361new Array("622102","酒泉"),
362new Array("630100","西宁"),
363new Array("632121","果洛"),
364new Array("632221","海西"),
365new Array("632321","格尔木"),
366new Array("632521","海东"),
367new Array("632621","海北"),
368new Array("632721","玉树"),
369new Array("632802","黄南"),
370new Array("640101","银川"),
371new Array("640201","石嘴山"),
372new Array("642101","吴忠"),
373new Array("642221","固原"),
374new Array("650101","乌鲁木齐"),
375new Array("650201","克拉玛依"),
376new Array("652101","吐鲁番"),
377new Array("652201","哈密"),
378new Array("652301","昌吉"),
379new Array("652701","博乐"),
380new Array("652801","库尔勒"),
381new Array("652901","阿克苏"),
382new Array("653001","克州"),
383new Array("653101","喀什"),
384new Array("654101","伊犁"),
385new Array("655001","石河子"),
386new Array("655002","塔城"),
387new Array("655003","阿勒泰"),
388new Array("710001","台北"),
389new Array("211001","辽阳"),
390new Array("653201","和田"),
391new Array("820000","澳门"),
392new Array("810000","香港")
393);
394
395function FillProvinces(selProvince)
396{
397    selProvince.options[0]=new Option("请选择定制省份","000000");
398    for(i=0;i<Provinces.length;i++)
399    {
400        selProvince.options[i+1]=new Option(Provinces[i][1],Provinces[i][0]);
401        //selProvince.options[i+1]=new Option(Provinces[i][1],Provinces[i][1]);
402    }

403    selProvince.options[0].selected=true;
404    selProvince.length=i+1;
405}

406
407function FillCitys(selCity,ProvinceCode)
408{
409    //if the province is a direct-managed city, like Beijing, shanghai, tianjin, chongqin,hongkong, macro
410        //need not "请选择选项"
411        if(ProvinceCode=="110000"||ProvinceCode=="120000"||ProvinceCode=="310000"
412                 ||ProvinceCode=="810000"||ProvinceCode=="820000"||ProvinceCode=="500000")
413             count=0;
414        else
415                {selCity.options[0]=new Option("请选择定制城市",ProvinceCode);
416                count=1;}

417    for(i=0;i<Citys.length;i++)
418    {
419        if(Citys[i][0].toString().substring(0,2)==ProvinceCode.substring(0,2))
420        {
421            //selCity.options[count]=new Option(Citys[i][1],Citys[i][0]);
422            selCity.options[count]=new Option(Citys[i][1],Citys[i][0]);
423            count=count+1;
424        }

425    }

426    selCity.options[0].selected=true;
427    selCity.length=count;
428}

429
430function Province_onchange()
431{
432    FillCitys(g_selCity,g_selProvince.value);
433}

434
435function InitCitySelect(selProvince,selCity)
436{
437    //alert("begin");
438    g_selProvince=selProvince;
439    g_selCity=selCity;
440    selProvince.onchange=Function("Province_onchange();");
441    FillProvinces(selProvince);
442    Province_onchange();
443}

444function InitCitySelect2(selProvince,selCity,CityCode)
445{
446    InitCitySelect(selProvince,selCity)
447    for(i=0;i<selProvince.length;i++)
448    {
449        if(selProvince.options[i].value.substring(0,2)==CityCode.substring(0,2))
450        {
451            selProvince.options[i].selected=true;
452        }

453    }

454    Province_onchange();
455    for(i=0;i<selCity.length;i++)
456    {
457        if(selCity.options[i].value==CityCode)
458        {
459            selCity.options[i].selected=true;
460        }

461    }

462}

463//
464function myCustomize(pv,cv)
465{
466
467//document.getElementById("wfr").src="http://weather.news.sina.com.cn/iframe/weather/810000.html";
468 document.getElementById("wfr").src="http://weather.news.sina.com.cn/iframe/weather/"+cv+".html";
469 alert(document.getElementById("wfr").src);
470}

471
472function myCustomize1(province,city)
473{
474    if(province == city)
475    {
476        alert("请选择城市");
477        return false;
478    }

479    
480//alert(province+'hhh'+city);
481    /*var expires = new Date();
482    expires.setTime(expires.getTime() + 3 * 30 * 24 * 60 * 60 * 1000);
483    document.cookie = 'SINA_NEWS_CUSTOMIZE_city='+city+';expires=' + expires.toGMTString() + ';domain=sina.com.cn; path=/; ';*/

484        var expdate = new Date();
485        FixCookieDate(expdate);//修正MAC机器的BUG
486        expdate.setTime(expdate.getTime() + (1000*60*60*24*365));//设置Cookie的有效期为1年
487//        SetCookie('SINA_NEWS_CUSTOMIZE_city',city,expdate,'/');
488SetCookie('SINA_NEWS_CUSTOMIZE_city',city,expdate,'/','sina.com.cn');
489
490    document.getElementById("weather").src="http://news.sina.com.cn/iframe/weather/jump4weather.html";
491    //location.reload();
492}

493//-->
494        </script>
495    </HEAD>
496    <body MS_POSITIONING="GridLayout">
497        <form id="customize" method="post" runat="server">
498            <font color="#085ab8" face="黑体" style="FONT-SIZE:18px">定制城市</font><br>
499            <SELECT id="province" size="1" name="province" style="MARGIN-TOP:4px;MARGIN-BOTTOM:4px;WIDTH:110px">
500                <OPTION selected></OPTION>
501            </SELECT>
502            <SELECT id="city" size="1" name="city" style="MARGIN-TOP:4px;MARGIN-BOTTOM:4px;WIDTH:110px">
503                <OPTION selected></OPTION>
504            </SELECT>
505            <SCRIPT language="javascript">
506        InitCitySelect(document.customize.province,document.customize.city);
507            </SCRIPT>
508            <input type="button" style="BORDER-TOP-WIDTH:0px;MARGIN-TOP:4px;BORDER-LEFT-WIDTH:0px;BACKGROUND-IMAGE:url(http://image2.sina.com.cn/dy/weather/images/wf016.gif);BORDER-BOTTOM-WIDTH:0px;MARGIN-BOTTOM:4px;WIDTH:76px;HEIGHT:19px;BORDER-RIGHT-WIDTH:0px"
509                value=" " onclick="myCustomize(document.customize.province.value, document.customize.city.value);"><br>
510            <font color="#183888">选取您所需要的城市的名称 <iframe id=wfr name=wfr src="http://weather.news.sina.com.cn/iframe/weather/320201.html" frameborder="0"
511                    width="279" height="137" marginheight="0" marginwidth="0" scrolling="no" style="Z-INDEX: 101; LEFT: 200px; POSITION: absolute; TOP: 272px">
512                </iframe>,然后点击“定制完成”按钮就可以立即浏览定制好的页面。</font>
513        </form>
514    </body>
515</HTML>

1:新浪天气预报
 在页面中加入下面代码:
<iframe src="http://news.sina.com.cn/iframe/2006/weather/jump_new.html" frameborder="0" width="155" height="37"

marginheight="0" marginwidth="0" scrolling="no"></iframe>
就会显示你所在城市天气情况.

分析:主要是页面http://news.sina.com.cn/iframe/2006/weather/jump_new.html,断客户所在地,然后执行跳转到所在页面
比如上海:跳到了:http://www.sina.com.cn/iframe/2006/weather/310100.html

更详细页面(只是在原页面上加入了"_w")
http://weather.news.sina.com.cn/iframe/weather/310100_w.html
516