From f9b695f7345a2c31602b1a3998557f70974bdf64 Mon Sep 17 00:00:00 2001 From: taggon Date: Wed, 15 Jun 2011 10:02:55 +0000 Subject: [PATCH] Add the getCookie function git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8490 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- common/js/common.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/js/common.js b/common/js/common.js index 88c2eca4a..7713ae897 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -902,6 +902,11 @@ function setCookie(name, value, expire, path) { document.cookie = s_cookie; } +function getCookie(name) { + var match = document.cookie.match(new RegExp(name+'=(.*?);')); + if(match) return unescape(match[1]); +} + function is_def(v) { return (typeof(v)!='undefined'); }