<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="img/timg.ico" />
<title>查询天气</title>
<script src="js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<input type="text" name="uesrname" id="uesrname" value="" />
<button>查询天气</button>
<h1></h1>
<!--key=ba257a360de141ce8d0f1a4a1bf2e3b-->
<script type="text/javascript">
$('button').click(function(){
var city=$('#uesrname').val()
// $.get('https://free-api.heweather.com/s6/weather/now?location='+city+"&key=091902a7ef8a4327b7d3f677af3c123f",function(res){
// console.log(res)
// $('h1').html(res.HeWeather6[0].now.tmp)
// })
//$.ajax({
// type:"get",
// url:'https://free-api.heweather.com/s6/weather/now?location='+city+'&key=091902a7ef8a4327b7d3f677af3c123f',
// async:true,
// complete:function(res){
// console.log(res.responseJSON)
// }
// });
//}) $.ajax({
type:"get",
url:"https://free-api.heweather.com/s6/weather/now?location="+city+"&key=091902a7ef8a4327b7d3f677af3c123f",
async:true,
complete:function(res){
console.log(res)
}
});
})
</script>
</body>
</html>

随机推荐

  1. c++中不需要显示指出struct

    赫  21:48:16请教个问题赫  21:49:53类声明前对私有继承的结构,的struct定义是什么作用?类声明前对该类私有继承的结构,的struct定义是什么作用?赫  21:51:21stru ...

  2. windows安装Mycat并测试

    1.下载系统安装包 选择相应的版本进行下载,地址:http://dl.mycat.io/ .Mycat数据库分库分表中间件介绍 http://www.mycat.io/ 2.安装 安装mycat前需要 ...

  3. gulp简单使用

    1.安装gulp,由于某些在下不能解决的原因,故使用gulp 3.9.1版本 安装命令: npm install gulp@3.9.1 注意不要直接使用 : npm install gulp 安装,直 ...

  4. HttpWebRequest上传多文件和多参数——整理

    1.整理HttpWebRequest上传多文件和多参数.较上一个版本,更具普适性和简易型.注意(服务方web.config中要配置)这样就可以上传大文件了 <system.webServer&g ...

  5. Nginx开启Gzip压缩提升页面加载速度

    1.在 nginx 的conf 目录下新建 gzip.conf 文件 #开启gzip压缩 gzip on; #设置允许压缩的页面最小字节数 gzip_min_length 1k; #申请4个单位为16 ...

  6. 1.Eclipse下载、常用配置、快捷键

    Eclipse官网下载:https://www.eclipse.org/downloads/packages/ 自动补全 位置:Eclipse——Window——Perferences——Java—— ...

  7. Airport Express UVA - 11374

    In a small city called Iokh, a train service, Airport-Express, takes residents to the airport more q ...

  8. SpringBoot应用入门

    一.项目搭建 使用IDEA,点击create new project,然后左边的spring initializr,右边SDK1.8,URL:https://start.spring.io,next ...

  9. badboy录制脚本

    第一步:介绍badboy工具 1.1: 页面功能分析: 1. 界面视图,模拟浏览器,能够进行操作 2. 需要录制脚本的URL 3. 点击运行URL 4. Summary:运行的各指标,响应时间,成功事 ...

  10. Python3程序设计指南:02 数据类型

    目录 1.标识符与关键字 1.1 规则 1.2 约定 2.Integral类型 2.1 整数 2.1.1 数值型操作符与函数 2.1.2 使用数据类型创建对象 2.1.3 整数位逻辑操作符 2.2 布 ...