$("#detail_submit").on("click", function(){
    var title = $("#detail_form").find("input[name='title']");
    var content = $("#detail_form").find("textarea[name='content']");
    if($(title).val()==""){
      layer.tips('请填写话题名称', $(title), {tips: [1, '#FF5722']});
      return false;
    }
    if($(content).val()==""){
      layer.msg("请填写讨论内容", {icon: 2});
      return false;
    }
    $("#detail_form").ajaxSubmit({
        url: '/doketang/topicadd/basicok', 
        type: 'POST',
        dataType: "json", 
        beforeSend: function(){
          layer.load(0, {shade: [0.2, '#393D49']});
        },
        success: function(data){
          if(data.code=="success"){
              layer.msg('成功', {icon: 1}, function(){parent.window.location.reload();});
          }else{
              layer.msg(data.msg, {icon: 2});
          }
        },
        error: function(){
          layer.msg("系统错误，请联系管理员", {icon: 2});
        },
        complete: function(){
          layer.closeAll('loading');
        }
    });
    return false;
});