Created
May 8, 2014 13:51
-
-
Save HKH515/ca03c8fd1b89d00ae0fd 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
function getCookie(cname) // Nær í cookie (stal þessu af w3schools) | |
{ | |
var name = cname + "="; | |
var ca = document.cookie.split(';'); | |
for(var i=0; i<ca.length; i++) | |
{ | |
var c = ca[i].trim(); | |
if (c.indexOf(name)==0) return c.substring(name.length,c.length); | |
} | |
return ""; | |
} | |
// Til að skrifa cookie geriru document.cookie="hs=" + points; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment