<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<span style="text-align: center;display:block;" class="weather"> </span>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script>
$.ajax({
type:'get',
url:'https://127.0.0.1/analytics/attend?wsId=15112319',
headers: {
"authorization": "Basic MTUxMTIzMTk6MzQ2NTE1YmU4MTkwZDdiNDA2NWJlODMwMzRiY2Q5NDQ=",
},
success:function(response) {
//console.log(response);
//$(".weather").text("日均出勤:" + response.data.avgHours + br + "部门排名:" + response.data.rankDep + br + "公司排名:"+ response.data.rankCompany);
var html='';
$(".weather").empty();
html+="日均出勤:" + response.data.avgHours + '<br\>' + "部门排名:" + response.data.rankDep + '<br\>' + "公司排名:"+ response.data.rankCompany;
$(".weather").append(html);
},
error:function (xhr){
//console.log(xhr)
alert(xhr);
}
})
</script>
</body>
</html>
原文地址:https://www.cnblogs.com/ai594ai/p/14718854.html