javascript - How to create a cookie with a variable value -
javascript - How to create a cookie with a variable value -
i need create javascript cookie in order php (to exactly, need viewport height of browser, store in javascript cookie in order value within php). problem have no javascript experience, , dont't understand google's explanation.
i'd have value (var viewportheight = $(window).height();
) within cookie. how?
(google gives examples static value).
try this:
var viewportheight = $(window).height(); document.cookie = "viewportheight=" + viewportheight + ";";
javascript jquery cookies
Comments
Post a Comment