私はこれを持っています
<button class="create">create</button>
<button class="check">check</button>
と
$(document).ready(function() {
$("#set_state").change(function() {
var theState = $(this).val();
$.cookie('set_state', theState, {
expires: 5,
path: '/'
});
});
$(".check").click(function() {
alert("Your Selected Value from Cookie is : " + $.cookie('set_state'));
});
$(".delete").click(function() {
$.cookie('set_state', '', {
expires: -1
});
$("#set_state").val("");
alert('Cookie is deleted now, try to get cookie..!');
});
});
別のスレッドから取得したもの。私はこれに非常に慣れていないため、アラートに「Cookie から選択した値は未定義です」と表示される理由がわかりません。私は何が欠けていますか?