Hey guys, I need help with this simple thing, I am new to js but not entirely to web design.
I have task to make two values like this
'partizan=pogodak; expires=Sat; path=/'
'zvezda=promasaj; expires=Sat; path=/'
And now html thing, two buttons or drop down menu with this two values, partizan and zvezda
After person click on partizan for example cookie should be stored with value pogodak and next time person come to page, it will get message pogodak and redirect to some other page, not important atm, and cookies should expire on first Saturday.
Thanks in advance.
Be sure value and c_name are defined and have a value
var exdate=new Date();
var dayWeek = exdate.getDay();
var expiredays = 6 - dayWeek;
if (expiredays == 0) expiredays = 6; //If today is Saturday, kill it next Saturday.
document.cookie=c_name+ "=" + value + ";expires=" + exdate.toUTCString());
thank u for reply, can u give me example of html too, idk how to make 2 selections with 2 cookies
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)