我使用BlogEngine作爲我的博客平臺,我想知道在保存我的帖子後是否有阻止帖子重定向操作的方法,我嘗試調試代碼但是不能找不到重定向操作。在blogengine中保存帖子後阻止重定向
這是在客戶端的保存POST方法:
function SavePost() {
$('.loader').show();
var content = document.getElementById('<%=txtRawContent.ClientID %>') != null ? document.getElementById('<%=txtRawContent.ClientID %>').value : tinyMCE.activeEditor.getContent();
var title = document.getElementById('<%=txtTitle.ClientID %>').value;
var slug = document.getElementById('<%=txtSlug.ClientID %>').value;
var photo = document.getElementById('<%=txtPostPhoto.ClientID %>').value;
var kind = $("[id$='ddlKind'] option:selected").val();
var isPublished = $("[id$='cbPublish']").is(':checked');
var date = document.getElementById('<%=txtDate.ClientID %>').value;
var time = document.getElementById('<%=txtTime.ClientID %>').value;
var dto = {
"id": Querystring('id'),
"content": content,
"title": title,
"slug": slug,
"postPhoto": photo,
"kind": kind,
"isPublished": isPublished,
"date": date,
"time": time
};
//alert(JSON.stringify(dto));
$.ajax({
url: SiteVars.ApplicationRelativeWebRoot + "admin/AjaxHelper.aspx/SaveMiniPost",
type: "POST",
dataType: "json",
contentType: "application/json; charset=utf-8",
data: JSON.stringify(dto),
beforeSend: onAjaxBeforeSend,
success: function (result) {
var rt = result.d;
if (rt.Success) {
if (rt.Data) {
window.location.href = rt.Data;
} else {
ShowStatus("success", rt.Message);
}
} else ShowStatus("warning", rt.Message);
}
});
$('.loader').hide();
return false;
}
它是從add_entry.aspx頁面調用的,該頁面用於編輯帖子。 函數得到「return false」後重定向發生 – 2012-08-01 08:46:01