$(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";
}
});
}
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";
}
});
}