Created
July 12, 2018 08:56
-
-
Save Padilo300/c69e5684dfe3a18c90ac8e757c254dab to your computer and use it in GitHub Desktop.
Js вернет значение куки
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*эта функция вернет значение куки по имени*/ | |
function get_cookie ( cookie_name ) | |
{ | |
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' ); | |
if ( results ) | |
return ( unescape ( results[2] ) ); | |
else | |
return null; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment