NSESSION.g_user_nick ); } $('#GridView1 .plhf').each(function(){ var t = this, $t = $(t), id = $t.attr('data-id'); if( !id ) return; $.ajax({ url: 'ajax/qrpinglun-hf.asp?act=list', data: { ran: Math.random(), id: id }, success: function(d){ if( !d ) return; $t.html( ''+ d +'
' ); setParentHeight(); } }) }) $('#GridView1 .wyhf-btn').click(function(){ var t = $(this).parent().parent().next(), l = t.next().find('tr').length; if( DOMAINSESSION.g_user_id ){ t.find(':input[name=username]').val( DOMAINSESSION.g_user_nick ); }else{ t.find(':input[name=username]').val('沙发'+ (l ? l+1 : 1)); } t[ t.is(':hidden') ? 'show' : 'hide' ](); return false; }) $('#GridView1 .wyhf-form-btn').click(function(){ var t = this, $t = $(t), s = t.innerHTML, td = $t.parent(), id = td.find(':input[name=id]').val(), infoid = td.find(':input[name=infoid]').val(), username = td.find(':input[name=username]').val(), content = td.find(':input[name=content]').val(); if( s == '我要回复' ){ if( !username.length ){ alert('昵称不能为空'); return !1; } if( !content.length ){ alert('回复不能为空'); return !1; } t.innerHTML = '提交中...'; $.ajax({ type: 'post', url: 'ajax/qrpinglun-hf.asp?act=do', data: { ran: Math.random(), id: id, infoid: infoid, username: username, content: content }, success: function(d){ if( d == '0' ){ alert('信息有误'); } if( d == '-1' ){ alert('回复需含中文'); } t.innerHTML = '我要回复'; if( d == '1' ){ $t.before('回复成功').prev().delay(2000).fadeOut(function(){ $(this).remove(); $.ajax({ url: 'ajax/qrpinglun-hf.asp?act=list', data: { ran: Math.random(), id: id }, success: function(d){ if( !d ) return; $('#GridView1 .plhf[data-id='+ id +']').html( ''+ d +'
' ); $t.parent().parent().hide(); } }) }); td.find(':input[name=username]').val(''); td.find(':input[name=content]').val(''); } } }) } }) // 回复 end $('#GridView1 > tbody > tr').each(function(i){ if( i % 2 ){ $(this).addClass('backfafad2'); } }) $('#GridView1 td.showCity').each(function(){ var that = this; var s = this.innerHTML; var isBianJi = $(that).parent().html().indexOf('编辑') > -1; if( isBianJi ){ that.innerHTML = '来自: 北京 海淀'; return; } $.get('inc/pinglunCity.asp?ip='+s+'&ran='+Math.random(), function(d){ that.innerHTML = '来自: ' + d; }) }) var imycnum = $('#GridView1 span.mycnum').length; $('#GridView1 span.mycnum').each(function(){ $(this).find('span').html( imycnum-- ); }) // 替换前台显示 rDomain = /(www\.[\w.]+)|([\w.]{4,}\.((com)|(cn)|(net)))/g; rQQ = /(qq)\s*\d+/ig; rHM = /(\d{3})\d{4}(\d{4})/ig; //替换前台手机号码显示后4位为* $('#GridView1 td.showContent').each(function(){ var s = this.innerHTML; s = s.replace(rDomain, function(){ return 'alwindoor.com'; }) s = s.replace(rQQ, function($, $1){ return $1 + '***'; }) s = s.replace(rHM, function($, $1, $2){ //替换前台手机号码显示后4位为* return $1 + $2 + '****'; }) this.innerHTML = s; }) });
 
立即发表评论:
 昵称:    
 评论:  
        
 您觉得文章内容如何: 已经有19位读者对文章发表个人观点 
3
2
2
3
9
0