小小已然吧 关注:10贴子:115
  • 1回复贴,共1
dodododododo


1楼2013-04-13 23:14回复
    $(function(){
    CKEDITOR.replace("txt_content");
    });
    function submit(){
    if($("#txt_title").val()==""){
    alert("标题不能为空");
    return;
    }
    if($("#txt_date").val()==""){
    alert("日期不能为空");
    return;
    }
    if($("#txt_author").val()==""){
    alert("作者不能为空");
    return;
    }
    if(CKEDITOR.instances.txt_content.getData()==""){
    alert("内容不能为空");
    return;
    }
    $.ajax({
    url:"submit",
    type:"post",
    data:{
    title:$("#txt_title").val(),
    date:$("#txt_date").val(),
    content:CKEDITOR.instances.txt_content.getData(),
    author:$("#txt_author").val()
    },
    success:function(msg){
    alert(msg);
    if(msg == "提交成功"){
    $("#btn_publish").show();
    }
    }
    });
    }
    function publish(){
    $.ajax({
    url:"publish",
    success:function(msg){
    window.location = "http://www.smallyard.cn";
    }
    });
    }


    IP属地:北京3楼2015-03-31 21:13
    回复