<!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. Maven 梳理-安装配置

    项目构建过程包括[清理项目]→[编译项目]→[测试项目]→[生成测试报告]→[打包项目]→[部署项目]这几个步骤,这六个步骤就是一个项目的完整构建过程. 下载后解压   配置环境变量 F:\jtDev ...

  2. Spring MVC-从零开始-web.xml中classpath和classpath* 有什么区别

    web.xml中classpath和classpath* 有什么区别?classpath:只会到你的class路径中查找找文件;classpath*:不仅包含class路径,还包括jar文件中(cla ...

  3. redis-分片(转)

    转:https://www.cnblogs.com/houziwty/p/5167075.html 分片(partitioning)就是将你的数据拆分到多个 Redis 实例的过程,这样每个实例将只包 ...

  4. 阿里云服务器CentOS6.9 tomcat配置域名访问

    之前一直是ip访问项目,今天申请到一个测试域名,想要用设置用域名访问项目. 1.进入阿里云服务器中,修改tomcat中server.xml文件 cd /usr/local/apache-tomcat/ ...

  5. 『开发技术』Ubuntu与Windows如何查看CPU&GPU&内存占用量

    0 序·简介 在使用Ubuntu或者Windows执行一些复杂数据运算时,需要关注下CPU.GPU以及内存占用量,如果数据运算超出了负荷,会产生难以预测的错误.本文将演示如何用简单地方式,实时监控Ub ...

  6. Requests实践详解

    Requests是什么 Requests是用python语言基于urllib编写的,采用的是Apache2 Licensed开源协议的HTTP库 如果你看过上篇文章关于urllib库的使用,你会发现, ...

  7. idea中添加Run Dashboard

    可以在工程目录下找到.idea文件夹下的workspace.xml,在其中加入以下代码即可: <component name="RunDashboard"> <o ...

  8. python编程基础之十九

    字符串判断常用函数: str.isalpha()  # 判断是否是全字母 str.isdigit()   # 判断是否是全数字 str.isalnum()  # 判断是否是字母和数字组合 str.is ...

  9. Spring Boot 2.2 正式发布,大幅性能提升 + Java 13 支持

    之前 Spring Boot 2.2没能按时发布,是由于 Spring Framework 5.2 的发布受阻而推迟.这次随着 Spring Framework 5.2.0 成功发布之后,Spring ...

  10. java零碎知识(每种数据类型默认值,多大,取值范围)

    只要记下字节就好了 其它不必死记,取值范围:没有正负的,2的 字节数*8次方-1  , 凡是有正负的2的 (字节数*8)-1次方 -1 比如: 1.byte(有正负):先计算是2的几次方:字节数1*( ...