Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setCookie(cName, cValue) {
- document.cookie = cName + '=' + escape(cValue);
- }
- function getCookie(cName) {
- var cookie = document.cookie;
- var result, cStart, cEnd;
- if(cookie.length > 0) {
- if((cStart = cookie.indexOf(cName + '=')) != -1) {
- cStart = cStart + cName.length + 1;
- cEnd = cookie.indexOf(';', cStart);
- cEnd = (cEnd >= 0 ? cEnd : cookie.length);
- result = unescape(cookie.substring(cStart, cEnd));
- }
- }
- return result ? result : '';
- }
Add Comment
Please, Sign In to add comment