Skip to content

Instantly share code, notes, and snippets.

View RaidoS's full-sized avatar

Pavel RaidoS

  • free-lance
  • Russia
View GitHub Profile
<head>
<!-- Facebook – 1,200 x 628
Twitter – 1,024 x 576
Instagram – 1,080 x 1,080
LinkedIn – 552 x 368
Pinterest – 600 x 900
Google+ – 800 x 320
-->
<title>Заголовок страницы</title>
// This function gets cookie with a given name
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));