接口采用json数据格式
其中jsonpCallback必须为ccad
数据条目和首页一致
数据缓存更新时间1小时
目前只开放"人防要闻"、"公示公告"栏目
栏目 |
json地址 |
人防要闻 |
http://www.ccad.gov.cn/api/27.json |
公示公告 |
http://www.ccad.gov.cn/api/12.json |
字段说明
字段 |
属性 |
title |
文章标题 |
writer |
作者 |
source |
来源 |
senddate |
发布日期 |
typename |
栏目名称 |
url |
链接地址 |
JQuery实现示例 GitHub示例源代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Test Page</title>
<style>
#main{width:500px;}
li{list-style:none;font-size:14px;line-height:26px;}
a{color:#000; text-decoration:none;}
a:hover{color:red; text-decoration:none;}
.right{float:right;}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
$.ajax({
type: "get",
async: false,
url: "http://www.ccad.gov.cn/api/27.json",
dataType: "jsonp",
jsonpCallback: "ccad",
success: function(json){
for(var i=0; i<json.length; i++){
$("#main").append(
"<li><a href='" + json[i].url + "'>" + json[i].title+"</a> <span class=right>[" + json[i].senddate +"]</span></li>"
);
}
}
});
});
</script>
</head>
<body>
<div id=main></div>
</body>
</html>
关于本网站,有任何技术问题、咨询、建议,请邮件至 lhd@ccad.gov.cn