Created
January 31, 2011 12:35
-
-
Save metamn/803966 to your computer and use it in GitHub Desktop.
Writing a cookie with the current screen width
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script language="javascript"> | |
writeCookie(); | |
function writeCookie() { | |
var today = new Date(); | |
var the_date = new Date("December 31, 2023"); | |
var the_cookie_date = the_date.toGMTString(); | |
var the_cookie = "screen="+ screen.width; | |
var the_cookie = the_cookie + ";expires=" + the_cookie_date; | |
document.cookie=the_cookie; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment