$.ajax({
url:"result.php",
//data:{"page":i},
dataType:"json",
beforeSend:function(){
$("#load").append("<div id='loading'><img src='loading.gif'></div>");
},
success:function(json){
if(json){
$("#load").empty();
//alert(111);
var str = "";
$.each(json,function(index,array){
//alert(json);
//var str = "<div class=\"single_item\"><div class=\"element_head\">";
str += "<div class='author'>"+array['author']+"</div>";
str += "<div class=\"date\">"+array['date']+"</div>";
str += "<div class=\"title\ >"+array['title']+"</div>";
str += "<div class=\"more\"><a href='javascript:void(0)'>more>></a></div><br>";
str += "<div class='content'>"+array['content']+"</div><br><hr>";
$(".content").each(function(){
if($(this).text().length>100){
$(this).text($(this).text().substring(0,100));
$(this).html($(this).html()+'...');
}
})
$("#container").append(str);
});
}
}
});