我有一个用PHP和jQuery编写的删除函数。该功能的作用是删除当前用户发布的帖子(跟踪当前的user_id)。但是,当我点击"删除推文"它没有删除它,我也不明白为什么,因为代码不起作用,对我来说没什么用。
感谢您的时间和帮助。
图片:
网络标签:
以下代码段:
x$year <- gsub("[\\(|\\)]", "", x$year)
> x
movie year
1 Ace Ventura: When Nature Calls 1995
2 Twelve Monkeys (a.k.a. 12 Monkeys) 1995
3 Seven (a.k.a. Se7en) 1995
4 French Twist (Gazon maudit) 1995
5 Rumble in the Bronx (Hont faan kui) 1995
&#13;
$(function(){
$(document).on('click', '.deleteTweet', function(){
var tweet_id = $(this).data('tweet');
$.post('http://localhost:8888/twitter/core/ajax/deleteTweet.php', {showpopup:tweet_id}, function(data){
$('.popupTweet').html(data);
$('.close-retweet-popup,.cancel-it').click(function(){
$('.retweet-popup').hide();
});
});
});
$(document).on('click','.delete-it', function(){
var tweet_id = $(this).data('tweet');
$.post('http://localhost:8888/twitter/core/ajax/deleteTweet.php', {deleteTweet:tweet_id}, function(){
$('.retweet-popup').hide();
location.reload();
});
});
$(document).on('click', '.deleteComment', function(){
var tweet_id = $(this).data('tweet');
var commentID = $(this).data('comment');
$.post('http://localhost:8888/twitter/core/ajax/deleteComment.php', {deleteComment:commentID,tweet_id:tweet_id});
$.post('http://localhost:8888/twitter/core/ajax/popuptweets.php', {showpopup:tweet_id}, function(data){
$('.popupTweet').html(data);
$('.tweet-show-popup-box-cut').click(function(){
$('.tweet-show-popup-wrap').hide();
});
});
});
});
&#13;