daily pastebin goal
20%
SHARE
TWEET

getCookie function

a guest Dec 15th, 2011 190 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top