I see many websites today displaying information in divs that a user can choose to hide with onClick.
I’m assuming that upon click they set a cookie in the users browser that stops the message from showing again (at least whilst the cookie is set).
I would like to know what the quickest, most efficient way of doing this is. I haven’t included the jquery framework on my site and am undecided in whether I need it or not.
Is jQuery the best approach or is there a more lightweight way of doing it? Does jQuery majorly effect page speeds??
Already been answered here -> jQuery Toggle Cookie Support
I use jQuery on all my web development projects – its easy of use and small amount of code (required to be written) far out weighs any disadvantages (not that i can think of any!!)
You dont even have to host jQuery if you dont want to – let someone else (google) host it for you … this article is a couple of years (2008) old but still VERY relevant -> http://encosia.com/3-reasons-why-you-should-let-google-host-jquery-for-you/