url: "index.php/post/get_post",这个 url 返回 json 数据,如...
[{"id":"3","user_id":"2","message":"okiokiokio","is_active":"1","created_at":"2013-05-24 00:00:00","updated_at":"2013-05-24 00:00:00"}]
如何在特定字段中打印数据
$(document).ready(function(){
$.ajax({
type: "POST",
url: "<?php echo base_url();?>index.php/post/get_post",
datatype: 'json',
success: function(data){
$('#divusername').append(data.user_id);
}
});
});