Skip to content

Instantly share code, notes, and snippets.

@xhat
Last active December 11, 2015 04:18
Show Gist options
  • Save xhat/4544210 to your computer and use it in GitHub Desktop.
Save xhat/4544210 to your computer and use it in GitHub Desktop.
<!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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment