feed.js
3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
function FeedDel()
{
if(confirm("你确定删除该动态信息?"))
return true;
else
return false;
}
$(function(){
$('#arcticle').click(function() {
$.ajax({
type: "GET",
url: "feed.php",
dataType: "json",
success : function(data){
$('#FeedText').empty();
var html = '<div class="newarticlelist"><ul>';
$.each( data , function(commentIndex, comment) {
html += '<li><span>' + comment['senddate'] + '</span><span><a href="/member/index.php?uid='+ comment['userid'] +'">'+ comment['userid'] +'</a></span><a href="' + comment['htmlurl'] + '" target="_blank">' + comment['title'] + '</a></li>';
})
html +="</ul></div>";
$('#FeedText').html(html);
$("#arcticle").addClass("thisTab");
$("#myfeed").removeClass("thisTab");
$("#allfeed").removeClass("thisTab");
$("#score").removeClass("thisTab");
$("#mood").removeClass("thisTab");
}
});
});
})
$(function(){
$('#allfeed').click(function() {
$.ajax({
type: "GET",
url: "feed.php?type=allfeed",
dataType: "json",
success : function(data){
$('#FeedText').empty();
var html = '';
$.each( data , function(commentIndex, comment) {
html += '<div class="feeds_title ico' + comment['type'] + '"><span><a href="/member/index.php?uid='+ comment['uname'] +'">'+ comment['uname'] +'</a>' + comment['title'] + ' <em>' + comment['dtime'] + '</em></span><p>' + comment['note'] + '</p></div>';
})
$('#FeedText').html(html);
$("#allfeed").addClass("thisTab");
$("#myfeed").removeClass("thisTab");
$("#arcticle").removeClass("thisTab");
$("#score").removeClass("thisTab");
$("#mood").removeClass("thisTab");
}
});
});
})
//
$(function(){
$('#myfeed').click(function() {
$.ajax({
type: "GET",
url: "feed.php?type=myfeed",
dataType: "json",
success : function(data){
$('#FeedText').empty();
var html = '';
$.each( data , function(commentIndex, comment) {
html += '<div class="feeds_title ico' + comment['type'] + '"><span><a href="index.php?uid='+ comment['uname'] +'&action=feeddel&fid=' + comment['fid'] + '" onclick="return FeedDel()" class="act">删除</a><a href="/member/index.php?uid='+ comment['uname'] +'">'+ comment['uname'] +'</a>' + comment['title'] + ' <em>' + comment['dtime'] + '</em></span><p>' + comment['note'] + '</p></div>';
})
$('#FeedText').html(html);
$("#myfeed").addClass("thisTab");
$("#allfeed").removeClass("thisTab");
$("#arcticle").removeClass("thisTab");
$("#score").removeClass("thisTab");
$("#mood").removeClass("thisTab");
}
});
});
})
//我的动态
$(function(){
$.ajax({
type: "GET",
url: "feed.php?type=myfeed",
dataType: "json",
success : function(data){
$('#FeedText').empty();
var html = '';
$.each( data , function(commentIndex, comment) {
html += '<div class="feeds_title ico' + comment['type'] + '"><span><a href="index.php?uid='+ comment['uname'] +'&action=feeddel&fid=' + comment['fid'] + '" onclick="return FeedDel()" class="act">删除</a><a href="/member/index.php?uid='+ comment['uname'] +'">'+ comment['uname'] +'</a>' + comment['title'] + ' <em>' + comment['dtime'] + '</em></span><p>' + comment['note'] + '</p></div>';
})
$('#FeedText').html(html);
}
});
})