var fstr = "";$(document).ready(function() { ajaxstr('/api.php?op=category','ask',20,'#catid'); ajaxstr('/api.php?op=area','level',2,"#areaid"); /* $("#parentid").change(function(){ ajaxstr('/api.php?op=category','ask',$(this).val(),"#catid"); }) */ $("#areaid").change(function(){ ajaxstr('/api.php?op=area','china',$(this).val(),"#cityid"); }) $("#cityid").change(function(){ ajaxstr('/api.php?op=area','china',$(this).val(),"#townid"); }) }); function checkform(obj){ if($("#loginer_user_id").val()==''){ $.ajax({ url:'/usercenter/loginjson.php', type:'post', data: 'jsoncallback=login', dataType:'json', success:function(msg){ if(msg.status==1){ $("#loginer_user_id").val(msg.user_id); $("#loginer_username").html(''+msg.username+' 您好,欢迎您发表评论!(文明上网,理性发言)'); }else{ loginWin(); } } }); }else{ var msg = ""; if(obj.title.value=="" ){ msg += "标题不能为空!\n"; }else{ if(obj.content.value.length < 5 ){ msg += "标题不能少于5字符!\n"; } } if(obj.catid.value=="" ){ msg += "分类不能为空!\n"; } if(obj.content.value=="" ){ msg += "内容不能为空!\n"; }else{ if(obj.content.value.length < 10 ){ msg += "内容不能少于10字符!\n"; } } if( obj.piccode.value=="" ){ msg += "验证码不能为空!\n"; }else{ if( obj.piccode.value.length < 4 ){ msg += "验证码不能少于4字符!\n"; } } if(msg !="" ){ alert(msg); return false; }else{ obj.submit(); return true; } } } fstr += '
'; fstr += ' '; fstr += ''; document.write(fstr);