| | #1 |
| Active Warrior Join Date: 2015
Posts: 49
Thanks: 85
Thanked 0 Times in 0 Posts
|
Hi guys, i was wandering if there is any other way to write a cookie compliance code in css only? i mean i found many tutorials, all using java... is there a css only one? if not, which java is best according to you? (light and fast loading)? |
|
“Watch your thoughts, they become words; watch your words, they become actions; watch your actions, they become habits; watch your habits, they become character; watch your character, for it becomes your destiny.” F.O. | |
| |
| | #2 | |
| Active Warrior Join Date: 2015 Location: Kherson, Ukraine
Posts: 42
Thanks: 0
Thanked 8 Times in 8 Posts
|
Hi Arcsn)
you can use this code: Code: function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
var cookie_string = name + "=" + escape ( value );
if ( exp_y )
{
var expires = new Date ( exp_y, exp_m, exp_d );
cookie_string += "; expires=" + expires.toGMTString();
}
if ( path )
cookie_string += "; path=" + escape ( path );
if ( domain )
cookie_string += "; domain=" + escape ( domain );
if ( secure )
cookie_string += "; secure";
document.cookie = cookie_string;
}
set_cookie ( "key", "value" ); | |
| |
| The Following User Says Thank You to wordpress+expert For This Useful Post: |
| | #3 |
| Active Warrior Join Date: 2015
Posts: 49
Thanks: 85
Thanked 0 Times in 0 Posts
|
perfect. i was suspecting that css only is not a solution. I'll try to implement your code and see how is going... |
|
“Watch your thoughts, they become words; watch your words, they become actions; watch your actions, they become habits; watch your habits, they become character; watch your character, for it becomes your destiny.” F.O. | |
| |
| | #4 |
| Active Warrior Join Date: 2015
Posts: 49
Thanks: 85
Thanked 0 Times in 0 Posts
|
unfortunately this script is not working... this code shows the cookie value as null and undefined. ![]() will search for different one... |
|
“Watch your thoughts, they become words; watch your words, they become actions; watch your actions, they become habits; watch your habits, they become character; watch your character, for it becomes your destiny.” F.O. | |
| |
|
| Bookmarks |
| Tags |
| compliance, cookie, css, java, tips |
| |