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

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -