comment.js
来自「巴巴运动网源码 传智博客出品 不全 一部分代码 可以参考」· JavaScript 代码 · 共 29 行
JS
29 行
function comment_support(commentid){
if(commentid != getCookie("currentCommentID")){
var form = document.forms["supportOropposeForm"];
form.method.value = "support";
form.productId.value = commentid;
var objspcount = document.getElementById('spcount_'+ commentid);
form.submit();
objspcount.innerText = parseInt(objspcount.innerText) +1;
document.getElementById("commentiframe").src="about:blank"
setCookie("currentCommentID", commentid, 10*60);
}else{
alert("您已经为该贴投过票");
}
}
function comment_oppose(commentid){
if(commentid != getCookie("currentCommentID")){
var form = document.forms["supportOropposeForm"];
form.method.value = "oppose";
form.productId.value = commentid;
var objopcount = document.getElementById('opcount_'+ commentid);
form.submit();
objopcount.innerText = parseInt(objopcount.innerText) +1;
document.getElementById("commentiframe").src="about:blank"
setCookie("currentCommentID", commentid, 10*60);
}else{
alert("您已经为该贴投过票");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?