SHARE
TWEET

getCookie function

a guest Dec 15th, 2011 179 Never
  1. function getCookie(cookieName) {
  2.         var cookiePattern = new RegExp('(^|;)[ ]*' + cookieName + '=([^;]*)'),
  3.                 cookieMatch = cookiePattern.exec(document.cookie);
  4.                 if(cookieMatch){
  5.                         return cookieMatch[2];
  6.                 }
  7.                 return 0;
  8. };
RAW Paste Data
Top