保存的Cookie:
$.cookie(key,value,{ expires: expire }); //expire in days.
得到的cookie:
$.cookie(key);
當然
需要JS,你可以得到:
http://plugins.jquery.com/cookie/
function OnSubmit(){
$.cookie("textbox",$("#textbox").val(),{ expires: 1}); //stores cookie for 1 day, names textbox and stores the value
window.location.reload();
};
$(document).ready(function() {
var value = $.cookie("textbox");
$("#textbox").val(value === undefined || value === null ? "" : value); //insert the value stored in cookie "textbox" only if its not null or undefined , if it does insert empty string
});
而且se:onClick:OnSubmit