$(function() {
$.ajax({
type: 'GET',
url: 'https://www.dnpw.org/cn/api404-gohome.do?time='+Date(),
dataType: 'json',
success: function(result) {
addBox(result);
addBox2(result)
}
})
});
function addBox(result) {
$.each(result, function(index, obj) {
$('#babyinfo').append("
" + obj['name'] + "(" + obj['sex'] + ")
出生日期:" + obj['born'] + "
走失时间:" + obj['dis_time'] + "
走失地点:" + obj['dis_address'] + "
相关详情:" + obj['detail'] + "
查看详情… >> ");
})
}
function addBox2(result) {
$.each(result, function(index, obj) {
$('#showlist').append("");
})
}
$('#showlist').on('click', 'li', function() {
$(this).addClass('currents').siblings().removeClass('currents');
$('.hideit').eq($(this).index()).addClass('current').siblings().removeClass('current');
});
$(function() {
$.ajax({
type: 'GET',
url: 'https://www.dnpw.org/cn/api-thank?you=' + document.domain + '&style=12',
})
});
//BAIDU STAT
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?bf329994f1e3ebf56f3712e11a46cb4a";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();