0
我使用的查詢餅乾插件這樣的:Cookie的工作50%
$(document).ready(function(){
$('a.close').click(function(){
var user = $('div.popup article.user').html();
$.cookie('the_cookie', user, {path: "/", domain: "domain.com"});
message = $.cookie('the_cookie');
$('section#sidebar_right').html(message);
});
});
所以,當用戶點擊「關閉按鈕」,該Cookie獲取用戶名,並把它變成一個特定的區域,這
domain.com/test.php#close
當我刷新到這個網站:情況是在這個網站上創建
domain.com/test.php
餅乾消失了(我可以看到這個,因爲顯示的內容消失了)。
有人可以告訴我爲什麼嗎?
問候
編輯:
$(document).ready(function(){
$('a.close').click(function(){
var user = $('div.popup article.user').html();
$.cookie('the_cookie', user, {expires: "7",path: "/", domain: "domain.com"});
message = $.cookie('the_cookie');
$('section#sidebar_right').html(message);
});
});
=>仍然沒有工作,任何想法?
我編輯了我的問題,你可以看一下嗎?問候和感謝! – user3297073
你解決了這個問題嗎?它也可能是服務器覆蓋你的cookie。 –