Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Web Design (WordPress, Joomla, etc.) CSS + Cookies + Javascript

  • CSS + Cookies + Javascript

    Posted by Noor Khazal on March 28, 2010 at 9:24 pm

    Hey there..

    I’m having a really hard time figuring out cookies, im reading alot about it atm and its still pretty confusing.

    Ive created a site that gives you the chance to change the BG color by jquery telling css what bgcolor should be setting..

    I dont know how to “save” the color of choice to the client-side so that each time a visitor comes back, their choice isnt forgotten..

    dont know if it makes sense but thanks anyways!..

    Fernando Mol replied 16 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Fernando Mol

    March 29, 2010 at 8:57 pm

    A cookie is a little file saved in the computer of the user. There you can save a value for a variable, then use the variable in your page.

    In your example, you can save the color for the BG in the cookie, then load it each time the user enter your site.

    I don’t have an example for the code you need, but you can take a look in the w3schools to understand how cookies work.

    *Always share a link to your site and rate the posts. This is a free service for you and for us.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy