有没有一种方式可以根据自定义属性comment_id删除一个DIV?
我有以下代码,但它还没有完全工作。
我有以下代码,但它还没有完全工作。
<script type="text/javascript">
$('.delete_comment').live('click', function() {
// Url we request data from
$.get( "http://www.site.com/pages/delete/user_comment.php",
// Url parameters to send
{id:$(this).attr('comment_id'),c:'yes'},
// Output data from php file generated by PHP echo.
function(data)
{
var comment_id = $(this).attr('comment_id').val();
//alert(comment_id);
if (comment_id == data) {
$(this).remove();
}
});
});
</script>