用get,返回jsonp格式是一个多维对象然后进行输出代码如下
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
</head>
<body>
<script>
$(document).ready(function() {
$.ajax({
type: "get",
url: "http://v.juhe.cn/weather/index",
data: {
'key': '6e43559178016cdb9de6fd383e86a170',
'cityname': '新乡',
},
dataType: 'jsonp',
success: function(data) {
var arr = data.result;
console.log(arr);
for(var x in arr['future']){
for(var y in arr['future'][x]){
if(y != 'weather_id'){
document.write(arr['future'][x][y] + '<br>');
}
}
}
}
});
})
</script>
</body>
</html>