<!-- css -->
<style>
</style>
<!-- html -->
<h1></h1>
<p></p>
<div></div>
<!-- js -->
<script>
$(function() {
// 获取数据开始
$.ajax({
// 定义请求方式 get获取 post发送
type: "GET",
// 请求的媒体类型
contentType: 'application/json;charset=UTF-8',
// 请求地址
// url: '/127.news.jlist.dhtml',
url: '/123.news.jdetail.dhtml?news_id=84',
// 请求成功时
success: function(res) {
var newslist = jQuery.parseJSON(res);
// console.log(res);
//append 添加
$('h1').append(newslist.news_title);
$('p').append(newslist.view_time);
$('div').append(newslist.newscontent);
},
// 请求失败时
error: function(e) {}
})
})
</script>