$(document).ready(function() { $('#comment').val("我也来说两句!"); $('#to_comment').click(function() { $('#comment').focus(); }); $.post("member/login.php", 'action=ajax_return', function(data){ $("#js_islogined").val(data); }); $('.checklogin').click(function() { if($("#js_islogined").val()==0) { $("#loginbox").show(); $("#repley_layer").show(); return false; } }); }); function reply_restoration() { if($('#comment').val() == '') { $('#comment').val("我也来说两句!"); } } function reply_clearfield() { if ($('#comment').val() == "我也来说两句!") { $('#comment').val(""); } document.getElementById('code_img').style.display = 'inline';document.getElementById('code_img').src='checkcode.php'; } function ajaxload(commentid) { var data = "&commentid="+commentid+"&keyid=phpcms-content-title-66377&verify=0416d671f3920ea61c212a2eb10e731e" ; var url = "http://www.compressor.cn/comment/?action=ajaxpost"; //alert(data); $.ajax({ type: "POST", url: url, data: data, success: function(msg){ $('#repley_layer').html(msg); } }); } function voteFor(id) { this.id = id; var url = "comment/?action=vote"; var data = '&id='+id + '&field=support'; $.ajax({ url: url, data: data, type: 'post', success :function (msg){ $('#count_'+ id+'_1 a').removeAttr("href").text(msg).css('color','red').css('cursor','pointer'); } }); } function voteAgainst (id) { this.id = id; var url = "comment/?action=vote"; var data = '&id='+id + '&field=against'; $.ajax({ url: url, data: data, type: 'post', success :function (msg){ $('#count_'+ id+'_0 a').removeAttr("href").text(msg).css('color','blue').css('cursor','pointer'); } }); } function checkForm() { if($("#js_islogined").val()==0) { $("#loginbox").show(); $("#repley_layer").show(); return false; } if($('#comment').val() == '' || $('#comment').val() == "我也来说两句!") { alert("内容不能为空"); $('#comment').focus(); return false; } if($('#checkcode').val() == '' ) { alert("验证码不能为空"); $('#checkcode').focus(); return false; } if ($('#comment').val().length > 1000) { alert("内容太长,最多 1000 个文字"); return false; } } function loginCheck2() { if($.trim($("#username2").val()) == '请输入您的账号' || $.trim($("#username2").val()).length==0) { alert('您好,请正确输入用户名再试。'); return false; } if($.trim($("#password2").val()).length==0) { alert('您正确输入密码。'); return false; } return true; } function loginSubmit2(login, uc) { var username = document.getElementById('username2'); var password = document.getElementById('password2'); if(!loginCheck2(login)){ return false;} if(uc == 1) return true; $.post("member/login.php", 'action=ajax&username='+username.value+'&password='+password.value, function(data){ $("#js_islogined").val(data); if(data == 1) { $('#loginbox').hide(); $("#repley_layer").hide(); $("#div_login2").hide(); $("#div_logined2").show(); $("#logined_username2").html(username.value); alert('登录成功'); } else { alert('登录失败,请重新登录'); redirect(login.action); } username.value = password.value = ''; }); return false; } function logout2(url) { $.get(url+'&id='+Math.random()*5, function(data){ if(data != 1) alert(data); }); $('#div_logined2').hide(); $('#div_login2').show(); } function loginshow2() { var auth = getcookie('auth'); if(auth != null) { $('#logined_username2').html(unescape(getcookie('username'))); $('#div_login2').hide(); $('#div_logined2').show(); } else { $('#div_logined2').hide(); $('#div_login2').show(); } } $(function(){ loginshow2(); }); function close() { $("#repley_layer").remove(); } document.write("

gshzhanquan2021-03-02 21:30:47

学习了
鼓励一下+1
");