- ubuntu12.04环境下使用kvm ioctl接口实现最简单的虚拟机
- Ubuntu 通过无线网络安装Ubuntu Server启动系统后连接无线网络的方法
- 在Ubuntu上搭建网桥的方法
- ubuntu 虚拟机上网方式及相关配置详解
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.
这篇CFSDN的博客文章asp下以Json获取中国天气网天气的代码由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.
百度了一下,找了点别人的方法改进了一下。 获取天气网址:http://www.weather.com.cn/html/weather/101210701.shtml这里是温州的,当然其他城市自己搜索一下,换一下ID。 由于是写入cookies记录当天天气,所有需要在站点下浏览。 js代码: 。
复制代码代码如下
var Url=escape("http://m.weather.com.cn/data/101210701.html"); var COOKIE_info = "COOKIE_info"; var date = new Date(); var Hours=24-date.getHours()-1; var Mins=60-date.getMinutes()-1; var Secs=60-date.getSeconds(); date.setTime(date.getTime() + (1 * Hours * 60 * 60 * 1000) + (1 * 1 * Mins * 60 * 1000) + (1 * 1 * 1 * Secs * 1000)); var RD_cookie_info= $.cookie(COOKIE_info); $(function(){ if(RD_cookie_info==null) { Getdata(Url); } else{ $("#weather").html(RD_cookie_info); } }) function Getdata(Url) { $.ajax({ type:"GET", cache: "false", url: "AjaxGet.asp", data:"Url="+Url, dataType: "html", error: function(){$("#weather").html("读取失败...请刷新重试!");}, success: function(json){ var t = '('+json+')'; var result = eval(t); var Getinfo=""; Getinfo+=result.weatherinfo.date_y+" ";//年月日 Getinfo+=result.weatherinfo.date+" ";//农历年月日 Getinfo+=result.weatherinfo.week+" ";//星期几 Getinfo+="<br />";//换行 Getinfo+=result.weatherinfo.city;//获取城市名称 Getinfo+=" <img src=\"http://m.weather.com.cn/img/c"+result.weatherinfo.img1+".gif\"/> "//天气图片1 Getinfo+="<img src=\"http://m.weather.com.cn/img/c"+result.weatherinfo.img2+".gif\"/> ";//天气图片2 Getinfo+=result.weatherinfo.weather1+" ";//天气情况 Getinfo+=result.weatherinfo.temp1;//温度 $.cookie(COOKIE_info,Getinfo, { path: '/', expires: date }); $("#weather").html(Getinfo); } }); } 。
html代码: 。
复制代码代码如下
<div id="weather" style="font-size:12px;"></div> 。
这个是用网络上常见的asp抓取,当然也可以换成.net抓取或者其他。附上demo.
最后此篇关于asp下以Json获取中国天气网天气的代码的文章就讲到这里了,如果你想了解更多关于asp下以Json获取中国天气网天气的代码的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。
为了现在为我的 Spring 学期考试做好充分准备,我正在研究和试验图形问题。 我已经熟悉了像“旅行商”这样的典型问题,但是当我深入研究“中国 postman 问题”及其变体时,我立即觉得这个问题的一
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 4 年前。 Improve
据日经新闻今日报道,中国的 VR 技术正陆续登陆日本,主要服务于电子商务和在线营销领域。由于价格和技术均具有较强竞争力,受到日本商业界人士欢迎。 在 VR 看房技术方面具有优势的房地产中介贝壳找房
我们在 azure.com 上有一个带有 MySQL 数据库的 Web 应用程序。 我们正在尝试将其复制到 azure.cn。 所以我创建了我的网络应用程序,创建了数据库并将 phpmyadmin 添
我们有一个 Web 应用部署到 Azure 全局西部美国区域的 Azure 应用服务。它对于美国用户来说非常有效。但对于中国大陆用户来说,由于高延迟,他们的响应速度较低。 我想到的想法是将相同的应用程
我们有一个 Web 应用部署到 Azure 全局西部美国区域的 Azure 应用服务。它对于美国用户来说非常有效。但对于中国大陆用户来说,由于高延迟,他们的响应速度较低。 我想到的想法是将相同的应用程
实际上我正在中国开始一个项目,使用适用于 iO 和 Android 的 Google Maps SDK,我阅读了文档,它说在中国可用的 URL 是 http://maps.google.cn ,如何使
我尝试将东亚地区(香港位置)的存储帐户异地复制到中国 Azure 数据中心(中国华北、中国东部),但在创建存储帐户异地复制时找不到中国数据中心. 你能告诉我该怎么做吗? 最佳答案 Can you pl
北京(中国)地区非常独特,因为它几乎所有的东西都是独立的(与 AWS 全局分开)。例如,要使用 AWS CLI 列出我们必须指定的对象 region和 endpoint-url : aws --reg
众所周知,这些 map ,无论是常规街道 map 还是卫星 map ,在中国的特定地区都无法正确排列。那么哪个 map 排列正确,是卫星 map 还是默认街道 map ?一些网站表明卫星 map 是正
我为非中国 AWS 创建了 terraform 模板,现在想将它们调整为中国 (cn-north-1) 区域。简单地将区域更改为 cn-north-1 并不能在中国区域中使用正确的 AWS API。
我是一名优秀的程序员,十分优秀!