r_id = $("#comment_user" + comment_id).val(); var goods_id = $("#comment_goods" + comment_id).val(); if(reply_content == ''){ $("#reply-error" + comment_id).html(json_languages.please_message_input); return false; } Ajax.call('comment.php', 'act=comment_reply&comment_id=' + comment_id + '&reply_content=' + reply_content + '&goods_id=' + goods_id + '&user_id=' + user_id, commentReplyResponse, 'POST', 'JSON'); }); $('.comment_nice').click(function(){ var T = $(this); var comment_id = T.data('commentid'); var goods_id = T.data('idvalue'); var type = 'comment'; Ajax.call('comment.php', 'act=add_useful&id=' + comment_id + '&goods_id=' + goods_id + '&type=' + type, niceResponse, 'GET', 'JSON'); }); }); function commentReplyResponse(res){ if(res.err_no == 1){ var back_url = res.url; $.notLogin("get_ajax_content.php?act=get_login_dialog",back_url); return false; }else if(res.err_no == 2){ $("#reply-error" + res.comment_id).html(json_languages.been_evaluated); }else{ $("#reply-error" + res.comment_id).html(json_languages.Add_success); $("#reply_content" + res.comment_id).val(''); $("#reply-textarea" + res.comment_id).addClass('hide'); $(".reply-count").addClass('red'); } $(".comment-reply" + res.comment_id).html(res.content); $(".reply-count" + res.comment_id).html(res.reply_count); } function niceResponse(res){ if(res.err_no == 1){ var back_url = res.url; $.notLogin("get_ajax_content.php?act=get_login_dialog",back_url); return false; }else if(res.err_no == 0){ $(".reply-nice" + res.id).html(res.useful); $(".comment_nice").addClass("selected"); } } -->