// 点击评论发表按钮
function() {
$("#button").unbind("click"); //点击评论按钮后对评论按钮进行解绑(点击事件无效,避免多次请求)
// 评论的图文信息Id
var courseId = $("#button").attr("gift-id");
var score = $("#scoreNumber").val();
// 评论内容
var content = $("#content").val();
// 评论内容
$.post("/wx/commentNew/commentNews", {
"graphicInformationId" : courseId,
"score" : score,
"content" : content
}, function(json) {
$("#button").bind("click");//当前这次评论请求完成后 重新对该评论按钮绑定点击事件
if (json.responseCode == "_200") {
// 关闭评论框
$("#comment").hide();
//刷新页面
window.location.reload();
} else {
layer.open({
content : json.errorMsg,
time : 3
});
}
}, "json");
}
提交类事件如果是新增插入业务,js对按钮解绑
最新推荐文章于 2024-10-21 19:16:45 发布
