Created
June 25, 2010 13:06
-
-
Save meritt/452820 to your computer and use it in GitHub Desktop.
This file contains 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
// Если localStorage доступен, используем его | |
if (('localStorage' in window) && window.localStorage !== null) { | |
localStorage.taglist = '["#html5","#css3","#simonenko"]'; | |
} else { | |
// если старый браузер, используем Cookie. | |
var date = new Date(); | |
date.setTime(date.getTime() + (365*24*60*60*1000)); | |
document.cookie = 'taglist=["#html5","#css3","#simonenko"]; expires=' + date.toGMTString() + '; path=/'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment