0
我有下面的代碼工作,但dosent達到預期效果:jQuery的Cookie的插件和重定向
$(".switch_org").click(function(e){
var id = $(this).attr('id');
var orgID = id.split("_");
e.preventDefault();
$.cookie('current_organisation', orgID[1], { expires: 1, path: '/' });
window.location.replace("index.php");
});
的cookie設置工作正常但網頁是不是重定向到index.php它只是重新加載相同的頁面。難道我做錯了什麼?是否有額外的步驟可以添加,以便它重定向到index.php?
感謝
我曾嘗試這些,我又嘗試過,仍然只是用新的cookie集重新加載相同的頁面。 – Elliot 2013-02-15 09:13:53