0
我的代碼有什麼問題,爲什麼cookie是空的?jquery,javascript對象插入cookie
<script type="text/javascript">
$(document).ready(function(){
personObj = new Object();
personObj.firstname="John";
personObj.lastname="Doe";
$.cookie("test_cookie", personObj, { path: "/"}, { expires: 1 });
});
</script>
我需要得到這樣的結果:
test_cookie => array(personObj => array(firstname=>"John", lastname=>"Doe"))
感謝;)
你使用哪個插件? – 2011-02-03 14:14:27
Cookie插件:https://github.com/carhartl/jquery-cookie/blob/master/jquery.cookie.js#L63 – lolalola 2011-02-03 14:38:30