function ETravelCMS_Comment_Action(sdo,id){ if(sdo==1){ $('#ETravelCMS_Comment_Good'+id).load('/system/comment.asp?do=dafencomment&g=1&id='+id); }else{ $('#ETravelCMS_Comment_Shit'+id).load('/system/comment.asp?do=dafencomment&g=0&id='+id); } } function ETravelCMS_Comment_PageChange(page){ $('#ETravelCMS_Comment_List').load('/system/comment.asp?do=list&cid=2906&ctype=Module&page='+page+'&T='+Math.random()); } $(document).ready( function(){ $('#ETravelCMS_Comment_PostForm').html('
姓名:联系方式:
'); $('#ETravelCMS_Comment_Post_Name').click( function(){ if(this.value=='匿名')this.value=''; } ).blur( function(){ if(this.value=='')this.value='匿名' } ); $('#ETravelCMS_Comment_Post_Button').click( function(){ if($.trim($('#ETravelCMS_Comment_Post_Name').val())==''){ $('#ETravelCMS_Comment_Post_Msg').css({color:'#FF0000'}).text('姓名必需填写!'); }else if($.trim($('#ETravelCMS_Comment_Post_Content').val()).length<8){ $('#ETravelCMS_Comment_Post_Msg').css({color:'#FF0000'}).text('评论内容不能少于8个字符!'); }else{ $('#ETravelCMS_Comment_Post_Msg').css({color:'#008000'}).text('评论数据发送中……'); this.disabled=true; $.post('/system/comment.asp?do=post',{id:'2906',type:'Module',name:escape($('#ETravelCMS_Comment_Post_Name').val()),contact:escape($('#ETravelCMS_Comment_Post_Contact').val()),content:escape($('#ETravelCMS_Comment_Post_Content').val())},function(data){ $('#ETravelCMS_Comment_Post_Button').removeAttr('disabled'); $('#ETravelCMS_Comment_Post_Msg').css({color:'#008000'}).text('完成!'); $('#ETravelCMS_Comment_List').html('
'+$('#ETravelCMS_Comment_Post_Name').val()+' 说道:
'+$('#ETravelCMS_Comment_Post_Content').val().replace(/\n/g,'
')+'
'+$('#ETravelCMS_Comment_List').html()); $('#ETravelCMS_Comment_Post_Contact').val(''); $('#ETravelCMS_Comment_Post_Content').val(''); setTimeout(function(){$('#ETravelCMS_Comment_Post_Msg').text('')},3000); }); } } ) $('#ETravelCMS_Comment_List').load('/system/comment.asp?do=list&cid=2906&ctype=Module&T='+Math.random()); } );