/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getCookie(name) { var cookies = document.cookie.split(/[; ]+/); for (var i = 0 ; i < cookies.length; i++) { if (cookies[i].substring(0,cookies[i].indexOf('=')) == name) { return cookies[i]; } } }
URL: http://www.arachna.com/edu/tutorials/mini/cookies/javascript.html