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

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -