<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JQuery-Ajax</title>
<!--武汉5天天气预报-->
<script src="js/jquery.min.js"></script>
<script>
$(function () {
$.ajax({
url: "http://wthrcdn.etouch.cn/weather_mini?city=武汉",
type:"get",
dateType: "json",
error: function () {
alert("服务器发生异常,请稍后重试!")
},
success: function (date) {
alert(date);
}
});
});
</script>
</head>
<body>
</body>
</html>
JQuery-Ajax异步请求获取天气预报($.ajax)
最新推荐文章于 2024-04-22 15:07:14 发布