1
調用location.reload()
後顯示隱藏字段值。如何在ajax成功調用location.reload()後顯示隱藏字段值
var ajaxRequest = $.ajax({
type: "POST",
url: "my url",//locating to another project action method which is already deployed and running in server
contentType: false,
processData: false,
data: data
});
ajaxRequest.done(function (xhr, textStatus) {
location.reload();//reloading page
$('#imageUploadScs').show();//displaying hidden field after reloading page
});
在location.reload()之後寫入的任何命令都不會發生,因爲您在頁面執行之前重新加載了頁面。所以你從頭開始。你的邏輯需要重新思考 – ADyson
你需要堅持價值..例如。在'localstorage'中,然後在重載時取回它 –
做一個頁面重新加載失敗了使用ajax的目的 – charlietfl