(jQuery) Save checkbox state on click in cookie

前端 未结 4 996
春和景丽
春和景丽 2021-02-04 19:26

There are a lot of topics regarding this function, nonetheless I can\'t seem to get it working. I\'ve googled on this specific case and a bunch of links let me here, but strangl

4条回答
  •  甜味超标
    2021-02-04 19:51

    If you don't strictly need to use cookies, using the newer HTML5 Web Storage (specifically the sessionStorage object in this case) is a lot easier and better than storing in a cookie:

    http://www.w3schools.com/html/html5_webstorage.asp

    Browser support is pretty full:

    http://caniuse.com/#search=sessionstorage

提交回复
热议问题