📄 comment.js
字号:
function CheckComment(){
if (document.formComment.UserName.value==""){
alert("请输入您的姓名!");
document.formComment.UserName.focus();
return false;
}
if (document.formComment.UserEmail.value=="")
{
alert("请输入您的邮箱!");
document.formComment.UserEmail.focus();
return false;
}
if (document.formComment.Argue.checked==true)
{
if (document.formComment.CommentTitle.value=="")
{
alert("请输入辩论标题!");
document.formComment.CommentTitle.focus();
return false;
}
if (document.formComment.AgreeContent.value=="")
{
alert("请输入辩论正方内容!");
document.formComment.AgreeContent.focus();
return false;
}
if (document.formComment.DisAgreeContent.value=="")
{
alert("请输入辩论反方内容!");
document.formComment.DisAgreeContent.focus();
return false;
}
}
else
{
if (document.formComment.CommentContent.value=="")
{
alert("请输入评论内容!");
document.formComment.CommentContent.focus();
return false;
}
}
return true;
}
function checkArgue()
{
if (document.formComment.Argue.checked==true)
{
document.getElementById('NoArgue').style.display="none";
document.getElementById('ArgueTitle').style.display="";
document.getElementById('IsArgue').style.display="";
}
else
{
document.getElementById('NoArgue').style.display="";
document.getElementById('ArgueTitle').style.display="none";
document.getElementById('IsArgue').style.display="none";
}
}
function comment_agree(commentid)
{
if (comment_chkok(commentid)){return;}
var post = "Action=agree&Ajax=1&CommentID=" + commentid
var Ajax = new Cl_Ajax();
Ajax.Url = "Property.asp";
Ajax.SucDo = "comment_suc('agree',"+commentid+")";
Ajax.Post(post);
}
function comment_disagree(commentid)
{
if (comment_chkok(commentid)){return;}
var post = "Action=disagree&Ajax=1&CommentID=" + commentid
var Ajax = new Cl_Ajax();
Ajax.Url = "Property.asp";
Ajax.SucDo = "comment_suc('disagree',"+commentid+")";
Ajax.Post(post);
}
function comment_middle(commentid)
{
if (comment_chkok(commentid)){return;}
var post = "Action=middle&Ajax=1&CommentID=" + commentid
var Ajax = new Cl_Ajax();
Ajax.Url = "Property.asp";
Ajax.SucDo = "comment_suc('middle',"+commentid+")";
Ajax.Post(post);
}
function comment_chkok(commentid)
{
if (get_cookie("comment_ok_" + commentid)=="yes"){
alert("您已经投过票了,请不要重复进行操作!");
return true;}
return false
}
function comment_suc(type,commentid)
{
var obj=document.getElementById(type + "_" + commentid);
if (obj)
{
var temp = parseInt(obj.innerHTML);
obj.innerHTML=temp + 1;
}
document.cookie="comment_ok_" + commentid + "=yes";
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -