< script>
$('.phone').text('+7 777 777-77-77');
< /script>
< script>
function set_cookie ( name, value, exp_y, exp_m, exp_d)
{
var cookie_string = name + "=" + escape ( value );
if ( exp_y )
{
var expires = new Date ( exp_y, exp_m, exp_d );
cookie_string += "; expires=" + expires.toGMTString();
}
document.cookie = cookie_string;
}
var name="change_phone"; // тут пишем имя для куки
var value="cpc";// тут пишем значение
var current_date = new Date;
var cookie_year = current_date.getFullYear ( ) + 1;
var cookie_month = current_date.getMonth ( );
var cookie_day = current_date.getDate ( );
set_cookie(name,value,cookie_year, cookie_month, cookie_day);
< /script>
var name="change_phone";
var value="cpc";
< script>
function get_cookie ( cookie_name )
{
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
if ( results )
return ( unescape ( results[2] ) );
else
return null;
}
var x = get_cookie ("change_phone"); //Пишем имя куки
if(x=="cpc") {//Пишем значение куки
$('.phone').text('+7 777 777-77-77');}
< /script>